public function execute_logged($message, $tag, $module, $variables = array()) { if (!is_null($retval = parent::execute())) { cvwobase_add_audit($message, $tag, $module, $variables); } return $retval; }
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); } }
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; }
/** * 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(); }
public function execute() { $this->insertQuery->fields($this->fields); $this->insertQuery->execute(); }