We extend the work of Thirukkanesh and Maharaj (Class Quantum Gravity 25:235001, 2008) by considering quadratic equation of state for the matter distribution to study the general situation of a compact relativistic body. Presence of electromagnetic field and anisotropy in the pressure are also assumed. Some new classes of static spherically symmetrical models of relativistic stars are obtained. All the results given in Thirukkanesh and Maharaj (Class Quantum Gravity 25:235001, 2008) and there in can also be recovered as a particular case of our work.