예제 #1
0
파일: Builder.php 프로젝트: xapg6acc/banana
 public function update(array $values)
 {
     $values = array_map(function ($value) {
         return $value instanceof Closure ? $this->subQuery($value) : $value;
     }, $values);
     $sql = $this->grammar->buildUpdate(array_merge($this->getParts(), ['sets' => $values]));
     return $this->db->query($sql);
 }
예제 #2
0
파일: Mysql.php 프로젝트: xapg6acc/banana
 public function buildSelect(array $parts)
 {
     $query = parent::buildSelect($parts);
     if (!empty($parts['unions'])) {
         $query = '(' . $query . ') ' . $this->buildUnions($parts['unions']);
     }
     return $query;
 }