-
Notifications
You must be signed in to change notification settings - Fork 102
/
Copy pathEntityRepository.stub
83 lines (69 loc) · 1.95 KB
/
EntityRepository.stub
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
namespace Doctrine\ORM;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Persistence\ObjectRepository;
/**
* @template TEntityClass of object
* @implements ObjectRepository<TEntityClass>
*/
class EntityRepository implements ObjectRepository
{
/** @var class-string<TEntityClass> */
protected $_entityName;
/**
* @phpstan-param mixed $id
* @phpstan-param int|null $lockMode
* @phpstan-param int|null $lockVersion
* @phpstan-return TEntityClass|null
* @phpstan-impure
*/
public function find($id, $lockMode = null, $lockVersion = null);
/**
* @phpstan-return list<TEntityClass>
*/
public function findAll();
/**
* @phpstan-param array<string, mixed> $criteria
* @phpstan-param array<string, string>|null $orderBy
* @phpstan-param int|null $limit
* @phpstan-param int|null $offset
* @phpstan-return list<TEntityClass>
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null);
/**
* @phpstan-param array<string, mixed> $criteria The criteria.
* @phpstan-param array<string, string>|null $orderBy
* @phpstan-return TEntityClass|null
* @phpstan-impure
*/
public function findOneBy(array $criteria, ?array $orderBy = null);
/**
* @phpstan-return class-string<TEntityClass>
*/
public function getClassName();
/**
* @phpstan-return class-string<TEntityClass>
*/
protected function getEntityName();
/**
* @param \Doctrine\Common\Collections\Criteria $criteria
*
* @return \Doctrine\Common\Collections\Collection
*
* @psalm-return \Doctrine\Common\Collections\Collection<int, TEntityClass>
*/
public function matching(Criteria $criteria);
/**
* @param __doctrine-literal-string $alias
* @param __doctrine-literal-string|null $indexBy
*
* @return QueryBuilder
*/
public function createQueryBuilder($alias, $indexBy = null);
/**
* @param array<string, mixed> $criteria
*
* @return int<0, max>
*/
public function count(array $criteria);
}