PHP Class Kdyby\Doctrine\QueryObject

QueryObject inheritors are great when you're printing a data to the user, they may be used in service layer but that's not really suggested. Don't be afraid to use them in presenters $this->template->articles = $this->articlesRepository->fetch(new ArticlesQuery()); or in more complex ways $productsQuery = new ProductsQuery(); $productsQuery ->setColor('green') ->setMaxDeliveryPrice(100) ->setMaxDeliveryMinutes(75); $productsQuery->size = 'big'; $this->template->products = $this->productsRepository->fetch($productsQuery);
Author: Filip Procházka ([email protected])
Inheritance: extends Nette\Object, implements Kdyby\Persistence\Query
Afficher le fichier Open project: kdyby/doctrine Class Usage Examples

Méthodes publiques

Свойство Type Description
$onPostFetch array

Méthodes publiques

Méthode Description
__construct ( )
count ( Kdyby\Persistence\Queryable $repository, ResultSet $resultSet = NULL, Doctrine\ORM\Tools\Pagination\Paginator $paginatedQuery = NULL ) : integer
fetch ( Kdyby\Persistence\Queryable $repository, integer $hydrationMode = AbstractQuery::HYDRATE_OBJECT ) : ResultSet | array
fetchOne ( Kdyby\Persistence\Queryable $repository ) : object If You encounter a problem with the LIMIT 1 here, you should instead of fetching toMany relations just use postFetch.
getLastQuery ( ) : Doctrine\ORM\Query
postFetch ( Kdyby\Persistence\Queryable $repository, Iterator $iterator ) : void

Méthodes protégées

Méthode Description
doCreateCountQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder
doCreateQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder
getQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query

Private Methods

Méthode Description
toQuery ( $query )

Method Details

__construct() public méthode

public __construct ( )

count() public méthode

public count ( Kdyby\Persistence\Queryable $repository, ResultSet $resultSet = NULL, Doctrine\ORM\Tools\Pagination\Paginator $paginatedQuery = NULL ) : integer
$repository Kdyby\Persistence\Queryable
$resultSet ResultSet
$paginatedQuery Doctrine\ORM\Tools\Pagination\Paginator
Résultat integer

doCreateCountQuery() protected méthode

protected doCreateCountQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder
$repository Kdyby\Persistence\Queryable
Résultat Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder

doCreateQuery() abstract protected méthode

abstract protected doCreateQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder
$repository Kdyby\Persistence\Queryable
Résultat Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder

fetch() public méthode

public fetch ( Kdyby\Persistence\Queryable $repository, integer $hydrationMode = AbstractQuery::HYDRATE_OBJECT ) : ResultSet | array
$repository Kdyby\Persistence\Queryable
$hydrationMode integer
Résultat ResultSet | array

fetchOne() public méthode

And if you really really need to hack it, just override this method and remove the limit.
public fetchOne ( Kdyby\Persistence\Queryable $repository ) : object
$repository Kdyby\Persistence\Queryable
Résultat object

getLastQuery() public méthode

public getLastQuery ( ) : Doctrine\ORM\Query
Résultat Doctrine\ORM\Query

getQuery() protected méthode

protected getQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query
$repository Kdyby\Persistence\Queryable
Résultat Doctrine\ORM\Query

postFetch() public méthode

public postFetch ( Kdyby\Persistence\Queryable $repository, Iterator $iterator ) : void
$repository Kdyby\Persistence\Queryable
$iterator Iterator
Résultat void

Property Details

$onPostFetch public_oe property

public array $onPostFetch
Résultat array