Ejemplo n.º 1
0
 /** Execute DELETE query
  * @return boolean
  */
 public function execute()
 {
     $result = parent::execute();
     if ($result) {
         return $result->rowCount();
     }
     return false;
 }
Ejemplo n.º 2
0
 /** Execute update query
  * @param boolean $getResultAsPdoStatement true to return the pdo statement instead of row count
  * @return int|boolean|PDOStatement
  */
 public function execute($getResultAsPdoStatement = false)
 {
     $result = parent::execute();
     if ($getResultAsPdoStatement) {
         return $result;
     }
     if ($result) {
         return $result->rowCount();
     }
     return false;
 }
Ejemplo n.º 3
0
 function __construct(FluentPDO $fpdo, $from)
 {
     $clauses = array('SELECT' => ', ', 'FROM' => null, 'JOIN' => array($this, 'getClauseJoin'), 'WHERE' => ' AND ', 'GROUP BY' => ',', 'HAVING' => ' AND ', 'ORDER BY' => ', ', 'LIMIT' => null, 'OFFSET' => null, "\n--" => "\n--");
     parent::__construct($fpdo, $clauses);
     # initialize statements
     $fromParts = explode(' ', $from);
     $this->fromTable = reset($fromParts);
     $this->fromAlias = end($fromParts);
     $this->statements['FROM'] = $from;
     $this->statements['SELECT'][] = $this->fromAlias . '.*';
     $this->joins[] = $this->fromAlias;
 }