Exemple #1
0
 public function testThatTheCorrectTypesAreReturned()
 {
     $select = $this->builder->select('*');
     $this->assertInstanceOf(Select::class, $select);
     $insert = $this->builder->insert('table');
     $this->assertInstanceOf(Insert::class, $insert);
     $update = $this->builder->update('table');
     $this->assertInstanceOf(Update::class, $update);
     $delete = $this->builder->delete('table');
     $this->assertInstanceOf(Delete::class, $delete);
     $expr = $this->builder->expression();
     $this->assertInstanceOf(Expression::class, $expr);
 }
Exemple #2
0
 /**
  * @param array $data
  *
  * @return Update
  */
 private function getUpdateQuery(array $data)
 {
     //This is a hack to prevent parameters being mixed up.
     $tempParameters = $this->parameters;
     $this->parameters = [];
     $query = $this->applyFilters($this->queryBuilder->update($this->entity->getTable())->values($this->parameters($data)));
     $this->parameters = array_merge($this->parameters, $tempParameters);
     return $query;
 }