1 | <?php |
||
23 | abstract class AbstractEntityService implements EntityServiceInterface |
||
24 | { |
||
25 | |||
26 | /** |
||
27 | * @var string |
||
28 | */ |
||
29 | protected $entityClass; |
||
30 | |||
31 | /** |
||
32 | * @var EntityInterface |
||
33 | */ |
||
34 | protected $entity; |
||
35 | |||
36 | /** |
||
37 | * Set FQ entity class name |
||
38 | * |
||
39 | * @param string $className |
||
40 | * |
||
41 | * @throws InvalidEntityClassException If the provided class name does |
||
42 | * not implements the Slick\Orm\EntityInterface interface. |
||
43 | * |
||
44 | * @return $this|self|AbstractEntityService |
||
45 | */ |
||
46 | 14 | public function setEntityClass($className) |
|
61 | |||
62 | /** |
||
63 | * Sets the entity that will be the subject of this service |
||
64 | * |
||
65 | * @param EntityInterface $entity |
||
66 | * |
||
67 | * @return $this|self|AbstractEntityService |
||
68 | */ |
||
69 | 2 | public function setEntity(EntityInterface $entity) |
|
74 | |||
75 | /** |
||
76 | * Get the entity FQ class name |
||
77 | * |
||
78 | * @return string |
||
79 | */ |
||
80 | 6 | public function getEntityClassName() |
|
87 | |||
88 | /** |
||
89 | * Gets entity class |
||
90 | * |
||
91 | * @return EntityInterface |
||
92 | */ |
||
93 | 4 | public function getEntity() |
|
102 | } |