Here is a relation in my Enquiry model:
In my EnquiryController if I have the following:
1) Am I right in assuming this would also delete the related records in Quote model? If not then how do I do this?
2) 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'.
'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();
1) Am I right in assuming this would also delete the related records in Quote model? If not then how do I do this?
2) 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'.