getState() public method

Gets the state of this query builder instance.
public getState ( ) : integer
return integer Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN.
コード例 #1
0
ファイル: Query.php プロジェクト: marcojetson/freckle
 /**
  * @return array
  */
 protected function run()
 {
     if (!$this->result || $this->queryBuilder->getState() === QueryBuilder::STATE_DIRTY) {
         $statement = $this->queryBuilder->execute();
         $statement->setFetchMode(\PDO::FETCH_ASSOC);
         $rows = $statement->fetchAll();
         $statement->closeCursor();
         $this->result = $this->mapper ? $this->mapper->collection($rows) : $rows;
     }
     return $this->result;
 }
コード例 #2
0
 /**
  * @test
  */
 public function getStateDelegatesToConcreteQueryBuilder()
 {
     $this->concreteQueryBuilder->getState()->shouldBeCalled()->willReturn(\Doctrine\DBAL\Query\QueryBuilder::STATE_CLEAN);
     $this->subject->getState();
 }
コード例 #3
0
 public function testSetFirstResult()
 {
     $qb = new QueryBuilder($this->conn);
     $qb->setFirstResult(10);
     $this->assertEquals(QueryBuilder::STATE_DIRTY, $qb->getState());
     $this->assertEQuals(10, $qb->getFirstResult());
 }
コード例 #4
0
 /**
  * Gets the state of this query builder instance.
  *
  * @return integer Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN.
  */
 public function getState()
 {
     return $this->queryBuilder->getState();
 }
コード例 #5
0
 /**
  * Gets the state of this query builder instance.
  *
  * @return int Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN.
  * @internal
  */
 public function getState() : int
 {
     return $this->concreteQueryBuilder->getState();
 }
コード例 #6
0
ファイル: SqlQueryBuilder.php プロジェクト: Maksold/platform
 /**
  * Gets the state of this query builder instance.
  *
  * @return integer Either Doctrine\DBAL\Query\QueryBuilder::STATE_DIRTY
  * or Doctrine\DBAL\Query\QueryBuilder::STATE_CLEAN.
  */
 public function getState()
 {
     return $this->qb->getState();
 }