public function save(Kwf_Model_Row_Interface $row, $data) { if ($data) { $parentRow = $row->getParentRow('ComponentToTag'); $row->status = 'denied'; $row->tags_to_components_id = null; $row->save(); $parentRow->delete(); } }
public function logLogin(Kwf_Model_Row_Interface $row) { if (!$row->logins) { $row->logins = 0; } $row->logins = $row->logins + 1; $row->last_login = date('Y-m-d H:i:s'); $row->save(); }
public function clearActivationToken(Kwf_Model_Row_Interface $row) { $row->activate_token = null; $row->save(); return true; }
public function clearAutoLoginToken(Kwf_Model_Row_Interface $row) { $row->autologin = null; $row->save(); return true; }
protected function _deleteRow(Kwf_Model_Row_Interface $row) { $row->deleted = 1; $row->save(); }
public function associateUserByParams(Kwf_Model_Row_Interface $user, $redirectBackUrl, array $params) { $userData = $this->_getUserDataByParams($redirectBackUrl, $params); $user->facebook_user_id = $userData->id; $user->save(); }
protected function _afterSave(Kwf_Model_Row_Interface $row) { $flightLandpointSelect = new Kwf_Model_Select(); $flightLandpointSelect->whereEquals('flightId', $row->id)->order('pos'); $landpointsModel = Kwf_Model_Abstract::getInstance('Landpoints'); $landpointsSelect = $landpointsModel->select()->where(new Kwf_Model_Select_Expr_Child_Contains('FlightLandpoints', $flightLandpointSelect)); $landpoints = $landpointsModel->getRows($landpointsSelect); $row->routeName = ''; foreach ($landpoints as $landpoint) { $row->routeName = $row->routeName . $landpoint->name . '. '; } if (strlen($row->routeName) < 2) { $row->routeName = 'Обеспечение ПСО/АСР'; } $row->save(); }
public function associateUserByCallbackParams(Kwf_Model_Row_Interface $user, $redirectBackUrl, array $params) { $userData = $this->_getUserDataByParams($redirectBackUrl, $params); $user->google_user_id = $userData['id']; $user->save(); }