$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);
Afficher le fichier
Open project: kdyby/doctrine
Class Usage Examples
Свойство | Type | Description | |
---|---|---|---|
$onPostFetch | array |
Méthode | Description | |
---|---|---|
__construct ( ) | ||
count ( Kdyby\Persistence\Queryable $repository, |
||
fetch ( Kdyby\Persistence\Queryable $repository, integer $hydrationMode = AbstractQuery::HYDRATE_OBJECT ) : |
||
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é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 |
Méthode | Description | |
---|---|---|
toQuery ( $query ) |
protected doCreateCountQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder | ||
$repository | Kdyby\Persistence\Queryable | |
Résultat | Doctrine\ORM\Query | Doctrine\ORM\QueryBuilder |
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 |
public getLastQuery ( ) : Doctrine\ORM\Query | ||
Résultat | Doctrine\ORM\Query |
protected getQuery ( Kdyby\Persistence\Queryable $repository ) : Doctrine\ORM\Query | ||
$repository | Kdyby\Persistence\Queryable | |
Résultat | Doctrine\ORM\Query |