示例#1
0
文件: Insert.php 项目: phpf/micro
 /** Execute insert query
  * @return integer last inserted id or false
  */
 public function execute()
 {
     $result = parent::execute();
     if ($result) {
         return $this->getPDO()->lastInsertId();
     }
     return false;
 }
示例#2
0
文件: Common.php 项目: phpf/micro
 /**
  * @return string
  */
 protected function buildQuery()
 {
     # first create extra join from statements with columns with referenced tables
     $statementsWithReferences = array('WHERE', 'SELECT', 'GROUP BY', 'ORDER BY');
     foreach ($statementsWithReferences as $clause) {
         if (array_key_exists($clause, $this->statements)) {
             $this->statements[$clause] = array_map(array($this, 'createUndefinedJoins'), $this->statements[$clause]);
         }
     }
     return parent::buildQuery();
 }