execute() public method

Execute insert query
public execute ( mixed $sequence = null ) : integer
$sequence mixed
return integer last inserted id or false
コード例 #1
0
 public function execute_logged($message, $tag, $module, $variables = array())
 {
     if (!is_null($retval = parent::execute())) {
         cvwobase_add_audit($message, $tag, $module, $variables);
     }
     return $retval;
 }
コード例 #2
0
ファイル: query.php プロジェクト: D4rk4/Kusaba-z
 public function execute()
 {
     if (!$this->preExecute()) {
         return NULL;
     }
     if (count($this->insertFields)) {
         return parent::execute();
     } else {
         return $this->connection->query('INSERT INTO {' . $this->table . '} DEFAULT VALUES', array(), $this->queryOptions);
     }
 }
コード例 #3
0
ファイル: GateKeeper.obj.php プロジェクト: jrgns/backend-php
 public static function assign($role_id, $access_type, $access_id)
 {
     $result = false;
     //if (!self::barredRole($role)) {
     if (!is_numeric($role_id)) {
         $role_id = Role::retrieve($role_id);
         $role_id = $role_id['id'];
     }
     $params = array(':role_id' => $role_id, ':access_type' => $access_type, ':access_id' => $access_id);
     $query = new SelectQuery('Assignment');
     $query->filter('`role_id`= :role_id')->filter('`access_type` = :access_type')->filter('`access_id` = :access_id');
     $id = $query->fetchColumn($params);
     if ($id) {
         $result = true;
     } else {
         $keys = array('role_id', 'access_type', 'access_id');
         $data = array_combine($keys, array_values($params));
         $query = new InsertQuery('Assignment');
         $query->data($data);
         $result = $query->execute() ? true : false;
     }
     //}
     return $result;
 }
コード例 #4
0
 /**
  * Executes the query without audit logging.
  * 
  * @return
  *   The last insert ID of the query, if one exists. If the query
  *   was given multiple sets of values to insert, the return value is
  *   undefined. If no fields are specified, this method will do nothing and
  *   return NULL. That makes it safe to use in multi-insert loops.
  */
 public function execute_special()
 {
     return parent::execute();
 }
コード例 #5
0
ファイル: InsertQueryEngine.php プロジェクト: itarato/micmod
 public function execute()
 {
     $this->insertQuery->fields($this->fields);
     $this->insertQuery->execute();
 }