コード例 #1
0
 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();
     }
 }
コード例 #2
0
 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();
 }
コード例 #3
0
 public function clearActivationToken(Kwf_Model_Row_Interface $row)
 {
     $row->activate_token = null;
     $row->save();
     return true;
 }
コード例 #4
0
 public function clearAutoLoginToken(Kwf_Model_Row_Interface $row)
 {
     $row->autologin = null;
     $row->save();
     return true;
 }
コード例 #5
0
 protected function _deleteRow(Kwf_Model_Row_Interface $row)
 {
     $row->deleted = 1;
     $row->save();
 }
コード例 #6
0
 public function associateUserByParams(Kwf_Model_Row_Interface $user, $redirectBackUrl, array $params)
 {
     $userData = $this->_getUserDataByParams($redirectBackUrl, $params);
     $user->facebook_user_id = $userData->id;
     $user->save();
 }
コード例 #7
0
ファイル: FlightController.php プロジェクト: nsams/aviashelf
 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();
 }
コード例 #8
0
 public function associateUserByCallbackParams(Kwf_Model_Row_Interface $user, $redirectBackUrl, array $params)
 {
     $userData = $this->_getUserDataByParams($redirectBackUrl, $params);
     $user->google_user_id = $userData['id'];
     $user->save();
 }