/** * @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; }
/** * @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(); }