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