1 | <?php |
||
17 | abstract class Manager |
||
18 | { |
||
19 | /** |
||
20 | * @var ManagerRegistry |
||
21 | */ |
||
22 | protected $managerRegistry; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $class; |
||
28 | |||
29 | public function __construct(ManagerRegistry $registry, string $class) |
||
34 | 24 | ||
35 | /** |
||
36 | 24 | * @param string $name |
|
37 | 24 | * @param array $arguments |
|
38 | 24 | * @return mixed |
|
39 | */ |
||
40 | public function __call($name, $arguments) |
||
49 | |||
50 | 3 | /** |
|
51 | 3 | * @return ObjectRepository |
|
52 | */ |
||
53 | 3 | public function getRepository() : ObjectRepository |
|
57 | |||
58 | 6 | /** |
|
59 | * @return ObjectManager |
||
60 | 6 | */ |
|
61 | public function getObjectManager() : ObjectManager |
||
65 | |||
66 | 15 | /** |
|
67 | * @param string $class |
||
68 | 15 | * @return Manager |
|
69 | */ |
||
70 | public function setClass(string $class) : Manager |
||
75 | 3 | ||
76 | /** |
||
77 | 3 | * @return string |
|
78 | 3 | */ |
|
79 | public function getClass() : string |
||
88 | 3 | ||
89 | /** |
||
90 | * Returns an instantiated entity class |
||
91 | 15 | * |
|
92 | * @return mixed |
||
93 | */ |
||
94 | public function create() |
||
99 | 3 | ||
100 | /** |
||
101 | 3 | * @param mixed $obj The entity |
|
102 | 3 | */ |
|
103 | public function delete($obj) |
||
108 | 3 | ||
109 | /** |
||
110 | 3 | * Will update/save the entity |
|
111 | 3 | * |
|
112 | 3 | * @param mixed $obj The entity |
|
113 | * @param bool $flush |
||
114 | */ |
||
115 | public function update($obj, $flush = true) |
||
123 | } |
||
124 |