@@ -103,6 +103,9 @@ |
||
103 | 103 | return $relationshipDetails; |
104 | 104 | } |
105 | 105 | |
106 | + /** |
|
107 | + * @param string $type |
|
108 | + */ |
|
106 | 109 | private function createRelationships($type, $relationships) |
107 | 110 | { |
108 | 111 | foreach ($relationships as $relationship) { |
@@ -11,6 +11,15 @@ |
||
11 | 11 | |
12 | 12 | interface ModelFactoryInterface |
13 | 13 | { |
14 | + /** |
|
15 | + * @param string $name |
|
16 | + */ |
|
14 | 17 | public function createModel($name, $context); |
18 | + |
|
19 | + /** |
|
20 | + * @param RecordWrapper $instance |
|
21 | + * |
|
22 | + * @return string |
|
23 | + */ |
|
15 | 24 | public function getModelTable($instance); |
16 | 25 | } |
17 | 26 | \ No newline at end of file |
@@ -24,6 +24,9 @@ |
||
24 | 24 | 'save', 'validate' |
25 | 25 | ]; |
26 | 26 | |
27 | + /** |
|
28 | + * @param string $table |
|
29 | + */ |
|
27 | 30 | public function __construct(RecordWrapper $wrapper, $table) { |
28 | 31 | $this->wrapper = $wrapper; |
29 | 32 | $this->adapter = $wrapper->getAdapter(); |
@@ -2,8 +2,6 @@ |
||
2 | 2 | |
3 | 3 | namespace ntentan\nibii; |
4 | 4 | |
5 | -use ntentan\panie\Container; |
|
6 | - |
|
7 | 5 | class Operations { |
8 | 6 | |
9 | 7 | private $wrapper; |
@@ -99,6 +99,9 @@ |
||
99 | 99 | return $this->config; |
100 | 100 | } |
101 | 101 | |
102 | + /** |
|
103 | + * @param RecordWrapper $model |
|
104 | + */ |
|
102 | 105 | public function getModelDescription($model) |
103 | 106 | { |
104 | 107 | return new ModelDescription($model); |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | use ntentan\atiaa\DbContext; |
6 | 6 | use ntentan\kaikai\Cache; |
7 | -use ntentan\panie\Container; |
|
8 | 7 | |
9 | 8 | /** |
10 | 9 | * A collection of utility methods used as helpers for loading models. |
@@ -50,7 +50,6 @@ |
||
50 | 50 | /** |
51 | 51 | * |
52 | 52 | * @param RecordWrapper $wrapper |
53 | - * @param DriverAdapter $adapter |
|
54 | 53 | * @param DataOperations $dataOperations |
55 | 54 | */ |
56 | 55 | public function __construct(RecordWrapper $wrapper, DataOperations $dataOperations, Driver $driver) { |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | |
149 | 149 | /** |
150 | 150 | * @method |
151 | - * @param type $name |
|
151 | + * @param string $name |
|
152 | 152 | * @param type $arguments |
153 | 153 | * @return type |
154 | 154 | */ |
@@ -172,6 +172,10 @@ discard block |
||
172 | 172 | return $this->retrieveItem($name); |
173 | 173 | } |
174 | 174 | |
175 | + /** |
|
176 | + * @param Relationship[] $relationships |
|
177 | + * @param integer $depth |
|
178 | + */ |
|
175 | 179 | private function expandArrayValue($array, $relationships, $depth, $index = null) |
176 | 180 | { |
177 | 181 | foreach ($relationships as $name => $relationship) { |
@@ -359,6 +363,9 @@ discard block |
||
359 | 363 | |
360 | 364 | } |
361 | 365 | |
366 | + /** |
|
367 | + * @param string $id |
|
368 | + */ |
|
362 | 369 | public function postSaveCallback($id) |
363 | 370 | { |
364 | 371 | |
@@ -387,7 +394,7 @@ discard block |
||
387 | 394 | |
388 | 395 | /** |
389 | 396 | * |
390 | - * @return DataAdapter |
|
397 | + * @return DriverAdapter |
|
391 | 398 | */ |
392 | 399 | public function getAdapter() |
393 | 400 | { |
@@ -84,8 +84,8 @@ discard block |
||
84 | 84 | $this->table = $table['table']; |
85 | 85 | $this->schema = $table['schema']; |
86 | 86 | } |
87 | - $this->quotedTable = ($this->schema ? "{$driver->quoteIdentifier($this->schema)}." : "") . $driver->quoteIdentifier($this->table); |
|
88 | - $this->unquotedTable = ($this->schema ? "{$this->schema}." : "") . $this->table; |
|
87 | + $this->quotedTable = ($this->schema ? "{$driver->quoteIdentifier($this->schema)}." : "").$driver->quoteIdentifier($this->table); |
|
88 | + $this->unquotedTable = ($this->schema ? "{$this->schema}." : "").$this->table; |
|
89 | 89 | $this->adapter->setModel($this, $this->quotedTable); |
90 | 90 | foreach ($this->behaviours as $behaviour) { |
91 | 91 | $behaviourInstance = $this->getComponentInstance($behaviour); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $this->initialize(); |
110 | 110 | return $this->context->getCache()->read( |
111 | 111 | "{$this->className}::desc", |
112 | - function () { |
|
112 | + function() { |
|
113 | 113 | return $this->context->getModelDescription($this); |
114 | 114 | } |
115 | 115 | ); |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public function createDriverAdapter() |
24 | 24 | { |
25 | - $class = __NAMESPACE__ . '\adapters\\' . Text::ucamelize($this->driverName) . 'Adapter'; |
|
25 | + $class = __NAMESPACE__.'\adapters\\'.Text::ucamelize($this->driverName).'Adapter'; |
|
26 | 26 | return new $class(); |
27 | 27 | } |
28 | 28 | } |