예제 #1
0
파일: Join.php 프로젝트: liftkit/database
 public function toString()
 {
     $string = $this->type . ' ' . $this->database->quoteIdentifier($this->table) . ' ';
     if ($this->alias) {
         $string .= 'AS ' . $this->database->quoteIdentifier($this->alias) . ' ';
     }
     $string .= $this->relation . ' (' . $this->condition . ')';
     return $string;
 }
예제 #2
0
파일: Table.php 프로젝트: liftkit/database
 /**
  * @param $row
  *
  * @return array
  */
 protected function filterColumns($row, $stripPrimary = false)
 {
     $columns = $this->database->getFields($this->table);
     if ($stripPrimary) {
         $columns = array_filter($columns, function ($column) {
             if ($this->database->primaryKey($this->table) == $column) {
                 return false;
             } else {
                 return true;
             }
         });
     }
     return array_intersect_key($row, array_flip($columns));
 }
예제 #3
0
파일: Model.php 프로젝트: liftkit/database
 /**
  * @param $identifier
  *
  * @return string
  */
 protected function quoteIdentifier($identifier)
 {
     return $this->database->quoteIdentifier($identifier);
 }