public function beforeDelete() { OphCiExamination_Et_PostOpComplications::model()->deleteAll('element_id = :element_id', array(':element_id' => $this->id)); return parent::beforeDelete(); }