src/EventSourcing/DBAL/EventStream.php
protected function prepareLoadStatement()
    {
        $queryBuilder = $this->connection->createQueryBuilder();

        $queryBuilder->select('id', 'uuid', 'playhead', 'metadata', 'payload', 'recorded_on')
            ->from($this->tableName)
            ->where('id >= :startid')
            ->setParameter('startid', $this->startId)
            ->orderBy('id', 'ASC')
            ->setMaxResults(1);

        if ($this->cdbids) {
            $queryBuilder->andWhere('uuid IN (:uuids)')
                ->setParameter('uuids', $this->cdbids, Connection::PARAM_STR_ARRAY);
        }

        if (!empty($this->aggregateType)) {
            $queryBuilder->andWhere('aggregate_type = :aggregate_type');
            $queryBuilder->setParameter('aggregate_type', $this->aggregateType);
        }

        return $queryBuilder->execute();
    }
protected function prepareLoadStatement()
    {
        $queryBuilder = $this->connection->createQueryBuilder();

        $queryBuilder->select('id', 'uuid', 'playhead', 'metadata', 'payload', 'recorded_on')
            ->from($this->tableName)
            ->where('id >= :startid')
            ->setParameter('startid', $this->startId)
            ->orderBy('id', 'ASC')
            ->setMaxResults(1);

        if ($this->cdbids) {
            $queryBuilder->andWhere('uuid IN (:uuids)')
                ->setParameter('uuids', $this->cdbids, Connection::PARAM_STR_ARRAY);
        }

        if (!empty($this->aggregateType)) {
            $queryBuilder->andWhere('aggregate_type = :aggregate_type');
            $queryBuilder->setParameter('aggregate_type', $this->aggregateType);
        }

        return $queryBuilder->execute();
    }
protected function prepareLoadStatement ( ) { $ queryBuilder = $ this -> connection -> createQueryBuilder ( ) ; $ queryBuilder -> select ( 'id' , 'uuid' , 'playhead' , 'metadata' , 'payload' , 'recorded_on' ) -> from ( $ this -> tableName ) -> where ( 'id >= :startid' ) -> setParameter ( 'startid' , $ this -> startId ) -> orderBy ( 'id' , 'ASC' ) -> setMaxResults ( 1 ) ; if ( $ this -> cdbids ) { $ queryBuilder -> andWhere ( 'uuid IN (:uuids)' ) -> setParameter ( 'uuids' , $ this -> cdbids , Connection :: PARAM_STR_ARRAY ) ; } if ( ! empty ( $ this -> aggregateType ) ) { $ queryBuilder -> andWhere ( 'aggregate_type = :aggregate_type' ) ; $ queryBuilder -> setParameter ( 'aggregate_type' , $ this -> aggregateType ) ; } return $ queryBuilder -> execute ( ) ; }
The load statement can no longer be 'cached' because of using the query
builder. The query builder requires all parameters to be set before
using the execute command. The previous solution used the prepare
statement on the connection, this did not require all parameters to be
set up front.

@return Statement
@throws DBALException
The load statement can no longer be cached because of using the query builder . The query builder requires all parameters to be set before using the execute command . The previous solution used the prepare statement on the connection this did not require all parameters to be set up front .