1 | <?php |
||
20 | class Factory implements FactoryInterface { |
||
21 | |||
22 | use EntityManagerConsumerTrait; |
||
23 | |||
24 | /** |
||
25 | * The sports db client. |
||
26 | * |
||
27 | * @var \TheSportsDb\Http\TheSportsDbClientInterface |
||
28 | */ |
||
29 | protected $sportsDbClient; |
||
30 | |||
31 | /** |
||
32 | * Creates a \TheSportsDb\Facotory\Factory object. |
||
33 | * |
||
34 | * @param \TheSportsDb\Http\TheSportsDbClientInterface $sportsDbClient |
||
35 | * The sports db client to make the requests. |
||
36 | * @param \TheSportsDb\Entity\EntityManagerInterface|null $entityManager |
||
37 | * The entity manager. |
||
38 | */ |
||
39 | public function __construct(TheSportsDbClientInterface $sportsDbClient, EntityManagerInterface $entityManager = NULL) { |
||
45 | |||
46 | /** |
||
47 | * {@inheritdoc} |
||
48 | */ |
||
49 | 2 | public function create(\stdClass $values, $entityType) { |
|
61 | |||
62 | /** |
||
63 | * Finalize the entity (or proxy). |
||
64 | * |
||
65 | * @param \TheSportsDb\Entity\EntityInterface $entity |
||
66 | * Either the real or the proxy entity for this factory. |
||
67 | * |
||
68 | * @return void |
||
69 | */ |
||
70 | 2 | protected function finalizeEntity(EntityInterface $entity) { |
|
76 | |||
77 | /** |
||
78 | * Gets the entity manager of this factory. |
||
79 | * |
||
80 | * @return \TheSportsDb\Entity\EntityManagerInterface |
||
81 | * The entity manager for this factory. |
||
82 | */ |
||
83 | 1 | public function getEntityManager() { |
|
86 | |||
87 | } |
||
88 |