|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <?php
-
- namespace Lc\SovBundle\Repository;
-
- use Doctrine\Common\Collections\Collection;
- use Doctrine\Common\Collections\Criteria;
- use Doctrine\ORM\AbstractQuery;
- use Doctrine\ORM\LazyCriteriaCollection;
- use Doctrine\ORM\NativeQuery;
- use Doctrine\ORM\Query;
- use Doctrine\ORM\Query\ResultSetMappingBuilder;
- use Doctrine\ORM\QueryBuilder;
-
- interface AbstractRepositoryInterface
- {
- public function setDefaultLocale($locale);
-
- public function getOneOrNullResult(QueryBuilder $qb, $locale = null, $hydrationMode = null);
-
- public function getResult(QueryBuilder $qb, $locale = null, $hydrationMode = AbstractQuery::HYDRATE_OBJECT);
-
- public function getArrayResult(QueryBuilder $qb, $locale = null);
-
- public function getSingleResult(QueryBuilder $qb, $locale = null, $hydrationMode = null);
-
- public function getScalarResult(QueryBuilder $qb, $locale = null);
-
- public function getSingleScalarResult(QueryBuilder $qb, $locale = null);
-
- /**
- * Creates a new QueryBuilder instance that is prepopulated for this entity name.
- *
- * @param string $alias
- * @param string $indexBy The index for the from.
- *
- * @return QueryBuilder
- */
- public function createQueryBuilder($alias, $indexBy = null);
-
- /**
- * Creates a new result set mapping builder for this entity.
- *
- * The column naming strategy is "INCREMENT".
- *
- * @param string $alias
- *
- * @return ResultSetMappingBuilder
- */
- public function createResultSetMappingBuilder($alias);
-
- /**
- * Creates a new Query instance based on a predefined metadata named query.
- *
- * @param string $queryName
- *
- * @return Query
- * @deprecated
- *
- */
- public function createNamedQuery($queryName);
-
- /**
- * Creates a native SQL query.
- *
- * @param string $queryName
- *
- * @return NativeQuery
- * @deprecated
- *
- */
- public function createNativeNamedQuery($queryName);
-
- /**
- * Clears the repository, causing all managed entities to become detached.
- *
- * @deprecated 2.8 This method is being removed from the ORM and won't have any replacement
- *
- * @return void
- */
- public function clear();
-
- /**
- * Finds an entity by its primary key / identifier.
- *
- * @param mixed $id The identifier.
- * @param int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants
- * or NULL if no specific lock mode should be used
- * during the search.
- * @param int|null $lockVersion The lock version.
- *
- * @return object|null The entity instance or NULL if the entity can not be found.
- * @psalm-return ?T
- */
- public function find($id, $lockMode = null, $lockVersion = null);
-
- /**
- * Finds all entities in the repository.
- *
- * @psalm-return list<T> The entities.
- */
- public function findAll();
-
- /**
- * Finds entities by a set of criteria.
- *
- * @param int|null $limit
- * @param int|null $offset
- * @psalm-param array<string, mixed> $criteria
- * @psalm-param array<string, string>|null $orderBy
- *
- * @psalm-return list<T> The objects.
- */
- public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null);
-
- /**
- * Finds a single entity by a set of criteria.
- *
- * @psalm-param array<string, mixed> $criteria
- * @psalm-param array<string, string>|null $orderBy
- *
- * @return object|null The entity instance or NULL if the entity can not be found.
- * @psalm-return ?T
- */
- public function findOneBy(array $criteria, ?array $orderBy = null);
-
- /**
- * Counts entities by a set of criteria.
- *
- * @psalm-param array<string, mixed> $criteria
- *
- * @return int The cardinality of the objects that match the given criteria.
- *
- * @todo Add this method to `ObjectRepository` interface in the next major release
- */
- public function count(array $criteria);
-
- /**
- * @return string
- */
- public function getClassName();
-
- /**
- * Select all elements from a selectable that match the expression and
- * return a new collection containing these elements.
- *
- * @return LazyCriteriaCollection
- * @psalm-return Collection<int, T>
- */
- public function matching(Criteria $criteria);
- }
|