public function loadRowModel($id)
 {
     $model = TemplateRow::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }
Exemplo n.º 2
0
 public function delete()
 {
     parent::delete();
     $rowList = TemplateRow::model()->findAll('templateId=:templateId', array(':templateId' => $this->id));
     if ($rowList != null) {
         foreach ($rowList as $model) {
             $model->delete();
         }
     }
 }