示例#1
0
文件: Fuel.php 项目: atabak/orm
 /**
  * {@inheritdoc}
  */
 public function insert($table, $row)
 {
     $this->currentQuery = $this->connection->insert($table);
     if ($row instanceof ModelInterface) {
         $this->currentQuery->values($row->toArray());
     } else {
         if ($row instanceof ModelCollectionInterface or is_array($row)) {
             foreach ($row as $model) {
                 $this->currentQuery->values($model->toArray());
             }
         } else {
             // TODO: No clue what we have, complain about it.
         }
     }
     return $this;
 }