Here is a relation in my Enquiry model:
'quotes'=>array(self::HAS_MANY, 'Quote', 'enquiry_id'),
In my EnquiryController if I have the following:
$model=Enquiry::model()->with('quotes')->findByPk($_GET['id']);
$model->delete();
-
Am I right in assuming this would also delete the related records in Quote model? If not then how do I do this?
-
How can I add a condition that ‘extends’ from the relation? So for example I need a condition that checks ‘accepted=1’ and a condition that checks ‘approved=1’.