@@ -12,7 +12,7 @@ |
||
12 | 12 | |
13 | 13 | public function boot() |
14 | 14 | { |
15 | - app('LaravelDoctrine\ORM\Configuration\Connections\ConnectionManager')->extend('sqlanywhere', function () { |
|
15 | + app('LaravelDoctrine\ORM\Configuration\Connections\ConnectionManager')->extend('sqlanywhere', function() { |
|
16 | 16 | return config('database.connections.sqlanywhere'); |
17 | 17 | }); |
18 | 18 | } |
@@ -34,11 +34,11 @@ discard block |
||
34 | 34 | public function testStore() |
35 | 35 | { |
36 | 36 | $response = $this->curlHelper |
37 | - ->post( |
|
37 | + ->post( |
|
38 | 38 | $this->getServiceTest()->getRepositoryTest()->getMockArray() |
39 | - ) |
|
40 | - ->send() |
|
41 | - ->getResponse(); |
|
39 | + ) |
|
40 | + ->send() |
|
41 | + ->getResponse(); |
|
42 | 42 | |
43 | 43 | $this->assertEquals(200, $response['code']); |
44 | 44 | |
@@ -61,10 +61,10 @@ discard block |
||
61 | 61 | } |
62 | 62 | |
63 | 63 | $response = $this->curlHelper |
64 | - ->setPosFixUrl('/'.$flushedMockArray['id']) |
|
65 | - ->put($flushedMockArray) |
|
66 | - ->send() |
|
67 | - ->getResponse(); |
|
64 | + ->setPosFixUrl('/'.$flushedMockArray['id']) |
|
65 | + ->put($flushedMockArray) |
|
66 | + ->send() |
|
67 | + ->getResponse(); |
|
68 | 68 | |
69 | 69 | $this->assertEquals(200, $response['code']); |
70 | 70 | |
@@ -80,10 +80,10 @@ discard block |
||
80 | 80 | $entity = $this->getServiceTest()->getRepositoryTest()->getFlushedMockObject(); |
81 | 81 | |
82 | 82 | $response = $this->curlHelper |
83 | - ->setPosFixUrl('/'.$entity->getId()) |
|
84 | - ->delete() |
|
85 | - ->send() |
|
86 | - ->getResponse(); |
|
83 | + ->setPosFixUrl('/'.$entity->getId()) |
|
84 | + ->delete() |
|
85 | + ->send() |
|
86 | + ->getResponse(); |
|
87 | 87 | |
88 | 88 | $this->assertEquals(200, $response['code']); |
89 | 89 |
@@ -7,8 +7,8 @@ discard block |
||
7 | 7 | public function testFindAll() |
8 | 8 | { |
9 | 9 | $entity = $this->getService() |
10 | - ->store($this->getRepositoryTest()->getMockArray()) |
|
11 | - ->flush(); |
|
10 | + ->store($this->getRepositoryTest()->getMockArray()) |
|
11 | + ->flush(); |
|
12 | 12 | |
13 | 13 | $findAll = $this->getService()->findAll()->getResult(); |
14 | 14 | |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | public function testStore() |
20 | 20 | { |
21 | 21 | $entity = $this->getService() |
22 | - ->store($this->getRepositoryTest()->getMockArray()) |
|
23 | - ->flush(); |
|
22 | + ->store($this->getRepositoryTest()->getMockArray()) |
|
23 | + ->flush(); |
|
24 | 24 | |
25 | 25 | $repository = $this->getService() |
26 | - ->getMainRepository(); |
|
26 | + ->getMainRepository(); |
|
27 | 27 | |
28 | 28 | $find = $repository->find($entity->getId()); |
29 | 29 | |
@@ -45,8 +45,8 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | $entity = $this->getService() |
48 | - ->update($flushedMockArray['id'], $flushedMockArray) |
|
49 | - ->flush(); |
|
48 | + ->update($flushedMockArray['id'], $flushedMockArray) |
|
49 | + ->flush(); |
|
50 | 50 | |
51 | 51 | $repository = $this->getService()->getMainRepository(); |
52 | 52 | |
@@ -63,12 +63,12 @@ discard block |
||
63 | 63 | public function testRemove() |
64 | 64 | { |
65 | 65 | $entity = $this->getService() |
66 | - ->store($this->getRepositoryTest()->getMockArray()) |
|
67 | - ->flush(); |
|
66 | + ->store($this->getRepositoryTest()->getMockArray()) |
|
67 | + ->flush(); |
|
68 | 68 | |
69 | 69 | $this->getService() |
70 | - ->remove($entity->getId()) |
|
71 | - ->flush(); |
|
70 | + ->remove($entity->getId()) |
|
71 | + ->flush(); |
|
72 | 72 | |
73 | 73 | $find = $this->getService()->getMainRepository()->find($entity->getId()); |
74 | 74 | } |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | $entity = $this->getMockObject($except); |
16 | 16 | |
17 | 17 | $this->getRepository() |
18 | - ->save($entity) |
|
19 | - ->flush($entity); |
|
18 | + ->save($entity) |
|
19 | + ->flush($entity); |
|
20 | 20 | |
21 | 21 | return $entity; |
22 | 22 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | $entity = $this->getFlushedMockObject(); |
88 | 88 | |
89 | 89 | $repository->remove($entity) |
90 | - ->flush($entity); |
|
90 | + ->flush($entity); |
|
91 | 91 | |
92 | 92 | $repository->find($entity->getId()); |
93 | 93 | } |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | public function prePersist() |
83 | 83 | { |
84 | 84 | $this->getRepository() |
85 | - ->preSave($this) |
|
86 | - ->validate($this); |
|
85 | + ->preSave($this) |
|
86 | + ->validate($this); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | /** |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | public function preUpdate() |
93 | 93 | { |
94 | 94 | $this->getRepository() |
95 | - ->preSave($this) |
|
96 | - ->validate($this); |
|
95 | + ->preSave($this) |
|
96 | + ->validate($this); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | public function getRepository() |
@@ -169,6 +169,9 @@ |
||
169 | 169 | return $this; |
170 | 170 | } |
171 | 171 | |
172 | + /** |
|
173 | + * @param string $key |
|
174 | + */ |
|
172 | 175 | final protected function checkOnyExceptInArray($key, array $options = null) |
173 | 176 | { |
174 | 177 | if ( |
@@ -4,12 +4,21 @@ discard block |
||
4 | 4 | |
5 | 5 | interface BaseRepositoryInterface |
6 | 6 | { |
7 | + /** |
|
8 | + * @return boolean|null |
|
9 | + */ |
|
7 | 10 | public function validate(BaseEntityInterface $entity); |
8 | 11 | |
12 | + /** |
|
13 | + * @return string |
|
14 | + */ |
|
9 | 15 | public function getEntityName(); |
10 | 16 | |
11 | 17 | public function query(); |
12 | 18 | |
19 | + /** |
|
20 | + * @return \Bludata\Doctrine\ORM\Repositories\QueryWorker |
|
21 | + */ |
|
13 | 22 | public function findAll(); |
14 | 23 | |
15 | 24 | public function findOneBy(array $filters, $abort = true); |
@@ -32,7 +41,13 @@ discard block |
||
32 | 41 | |
33 | 42 | public function createEntity(); |
34 | 43 | |
44 | + /** |
|
45 | + * @return \Bludata\Doctrine\ORM\Repositories\QueryWorker |
|
46 | + */ |
|
35 | 47 | public function createQueryWorker(); |
36 | 48 | |
49 | + /** |
|
50 | + * @return string |
|
51 | + */ |
|
37 | 52 | public function getMessageNotFound(); |
38 | 53 | } |
@@ -4,5 +4,8 @@ |
||
4 | 4 | |
5 | 5 | interface EntityManagerInterface |
6 | 6 | { |
7 | + /** |
|
8 | + * @return \Doctrine\ODM\MongoDB\DocumentRepository |
|
9 | + */ |
|
7 | 10 | public function getRepository($class); |
8 | 11 | } |
@@ -4,11 +4,20 @@ |
||
4 | 4 | |
5 | 5 | interface EntityTimestampInterface |
6 | 6 | { |
7 | + /** |
|
8 | + * @return \DateTime |
|
9 | + */ |
|
7 | 10 | public function getCreatedAt(); |
8 | 11 | |
12 | + /** |
|
13 | + * @return \DateTime |
|
14 | + */ |
|
9 | 15 | public function getUpdatedAt(); |
10 | 16 | |
11 | 17 | public function getDeletedAt(); |
12 | 18 | |
19 | + /** |
|
20 | + * @return void |
|
21 | + */ |
|
13 | 22 | public function setDeletedAt($date); |
14 | 23 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | /** |
27 | - * @return Bludata\Lumen\Application\BaseApplication |
|
27 | + * @return BaseApplication |
|
28 | 28 | */ |
29 | 29 | public function resource($descriptionGroup, $prefix, $controller, array $except = [], Closure $routes = null) |
30 | 30 | { |