示例#1
0
 /**
  * Inserts the item!
  * @return integer number of inserted rows (as usually 1)
  */
 public function insert()
 {
     $pk = $this->getPrimaryKey();
     if ($rows = rad_dbpdo::insert_struct($this, $this->_getTableName())) {
         $this->{$pk} = rad_dbpdo::lastInsertId();
     }
     return $rows;
 }
示例#2
0
 /**
  * Insert new user
  *
  * @param struct_core_users $user
  * @return count inserted records
  */
 public static function insertUser(struct_core_users $user)
 {
     return rad_dbpdo::insert_struct($user, RAD . 'users');
 }
示例#3
0
 /**
  * Alias for rad_dbpdo::insert_struct()
  * Need for insert some record as struct
  *
  * @param $struct rad_struct
  * @param $tablename - string
  *
  * @return number of inserted rows
  */
 protected function insert_struct(rad_struct $struct, $tablename, $binded = false)
 {
     return rad_dbpdo::insert_struct($struct, $tablename, $binded);
 }