示例#1
0
 /**
  * Protected function, to save this struct to it table by it primary key
  * @return integer number of updated rows (as usually 1)
  */
 public function save()
 {
     $prKey = $this->getPrimaryKey();
     if (!$this->{$prKey}) {
         return $this->insert();
     }
     return rad_dbpdo::update_struct($this, $this->_getTableName());
 }
示例#2
0
 /**
  * Update user row
  * @var integer
  */
 public static function updateUser(struct_core_users $user)
 {
     $result = rad_dbpdo::update_struct($user, RAD . 'users');
     if ($result) {
         rad_session::$user = $user;
         $_SESSION['user_dump'] = $user;
     }
     return $result;
 }
示例#3
0
 /**
  * Alias for rad_dbpdo::update_struct()
  * Need for update some record as struct
  *
  * @param $struct rad_struct
  * @param $tablename - string
  *
  * @return number of updated rows
  */
 protected function update_struct(rad_struct $struct, $tablename)
 {
     return rad_dbpdo::update_struct($struct, $tablename);
 }