Beispiel #1
0
 /**
  * Override the default execute function.
  *
  * @return int Last insert ID.
  */
 public function execute()
 {
     $result = parent::execute();
     return DatabaseConnectionFactory::get()->lastInsertId();
 }
Beispiel #2
0
 /**
  * Build a query string from a QueryAbstract
  * @param QueryAbstract $query
  * @return string
  */
 public function buildQuery(QueryAbstract $query)
 {
     $queryParts = $query->getQueryParts();
     return implode(' ', array_filter([$queryParts['type'], $this->getFields($queryParts), $this->getTable($queryParts), $this->getSet($queryParts), $this->getValues($queryParts), $this->getJoins($queryParts), $this->getWhere($queryParts), $this->getGroup($queryParts), $this->getOrder($queryParts), $this->getLimit($queryParts)], function ($var) {
         return $var !== null;
     }));
 }