1 | <?php |
||
17 | abstract class Manager |
||
18 | { |
||
19 | /** |
||
20 | * @var ManagerRegistry |
||
21 | */ |
||
22 | protected $managerRegistry; |
||
23 | |||
24 | /** |
||
25 | * @var ObjectManager |
||
26 | */ |
||
27 | protected $objectManager; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $class; |
||
33 | |||
34 | public function __construct(ManagerRegistry $registry, string $class) |
||
39 | |||
40 | /** |
||
41 | * @param string $name |
||
42 | * @param array $arguments |
||
43 | * @return mixed |
||
44 | */ |
||
45 | public function __call($name, $arguments) |
||
54 | |||
55 | /** |
||
56 | * @return ObjectRepository |
||
57 | */ |
||
58 | public function getRepository() : ObjectRepository |
||
62 | |||
63 | /** |
||
64 | * @return ObjectManager |
||
65 | */ |
||
66 | public function getObjectManager() : ObjectManager |
||
70 | |||
71 | /** |
||
72 | * @param string $class |
||
73 | * @return Manager |
||
74 | */ |
||
75 | public function setClass(string $class) : Manager |
||
80 | |||
81 | /** |
||
82 | * @return string |
||
83 | */ |
||
84 | public function getClass() : string |
||
93 | |||
94 | /** |
||
95 | * Returns an instantiated entity class |
||
96 | * |
||
97 | * @return mixed |
||
98 | */ |
||
99 | public function create() |
||
104 | |||
105 | /** |
||
106 | * @param mixed $obj The entity |
||
107 | */ |
||
108 | public function delete($obj) |
||
113 | |||
114 | /** |
||
115 | * Will update/save the entity |
||
116 | * |
||
117 | * @param mixed $obj The entity |
||
118 | * @param bool $flush |
||
119 | */ |
||
120 | public function update($obj, $flush = true) |
||
128 | } |
||
129 |