1 | <?php |
||
19 | class NullModel implements ModelInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var DocumentRepository |
||
23 | */ |
||
24 | private $repository; |
||
25 | |||
26 | /** |
||
27 | * Set document repository |
||
28 | * |
||
29 | * @param DocumentRepository $repository document repo |
||
30 | * |
||
31 | * @return void |
||
32 | */ |
||
33 | public function setRepository(DocumentRepository $repository) |
||
34 | { |
||
35 | $this->repository = $repository; |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * get repository instance |
||
40 | * |
||
41 | * @return DocumentRepository |
||
42 | */ |
||
43 | public function getRepository() |
||
47 | |||
48 | /** |
||
49 | * Find a single record by id |
||
50 | * |
||
51 | * @param string $id Record-Id |
||
52 | * |
||
53 | * @return Object |
||
|
|||
54 | */ |
||
55 | public function find($id) |
||
59 | |||
60 | /** |
||
61 | * Find all records |
||
62 | * |
||
63 | * @param \Symfony\Component\HttpFoundation\Request $request Request object |
||
64 | * |
||
65 | * @return Object[] |
||
66 | */ |
||
67 | public function findAll(Request $request) |
||
71 | |||
72 | /** |
||
73 | * Insert a new Record |
||
74 | * |
||
75 | * @param Object $entity Entity |
||
76 | * |
||
77 | * @return Object |
||
78 | */ |
||
79 | public function insertRecord($entity) |
||
83 | |||
84 | /** |
||
85 | * Update an existing entity |
||
86 | * |
||
87 | * @param string $id id of entity to update |
||
88 | * @param Object $entity entity with new data |
||
89 | * |
||
90 | * @return Object |
||
91 | */ |
||
92 | public function updateRecord($id, $entity) |
||
96 | |||
97 | /** |
||
98 | * Delete a record by id |
||
99 | * |
||
100 | * @param Number $id Record-Id |
||
101 | * |
||
102 | * @return null|Object |
||
103 | */ |
||
104 | public function deleteRecord($id) |
||
108 | |||
109 | /** |
||
110 | * Get the name of entity class |
||
111 | * |
||
112 | * @return string |
||
113 | */ |
||
114 | public function getEntityClass() |
||
118 | |||
119 | /** |
||
120 | * Get the connection name |
||
121 | * |
||
122 | * @return string |
||
123 | */ |
||
124 | public function getConnectionName() |
||
128 | } |
||
129 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.