Пример #1
0
 /**
  * @param AModel $model
  *
  * @return boolean
  */
 public function delete(AModel $model)
 {
     if (!$model->getIsNewRecord()) {
         $m = $this->_resolveModel($model)->findByPk($model->id);
         if ($m) {
             return $m->delete();
         }
     }
     return true;
 }
Пример #2
0
 /**
  * @param \YiiNodeSocket\Models\AModel $model
  *
  * @dataProvider modelsDataProvider
  */
 public function testGetDbDriver(\YiiNodeSocket\Models\AModel $model)
 {
     $this->assertInstanceOf('YiiNodeSocket\\Components\\Db\\DriverInterface', $model->getDbDriver());
 }
 /**
  * @return bool
  */
 protected function beforeValidate()
 {
     $this->can_send_event_from_js = (int) $this->can_send_event_from_js;
     $this->can_send_event_from_php = (int) $this->can_send_event_from_php;
     return parent::beforeValidate();
 }