@@ -2,8 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace yentu\commands; |
| 4 | 4 | |
| 5 | -use yentu\Yentu; |
|
| 6 | 5 | use clearice\ClearIce; |
| 6 | +use yentu\Yentu; |
|
| 7 | 7 | |
| 8 | 8 | /** |
| 9 | 9 | * |
@@ -30,6 +30,9 @@ |
||
| 30 | 30 | { |
| 31 | 31 | private $defaultSchema; |
| 32 | 32 | |
| 33 | + /** |
|
| 34 | + * @param boolean $defaultSchema |
|
| 35 | + */ |
|
| 33 | 36 | public function __construct($defaultSchema) |
| 34 | 37 | { |
| 35 | 38 | $this->defaultSchema = new Schema($defaultSchema); |
@@ -29,6 +29,10 @@ |
||
| 29 | 29 | 'query' => 'Query' |
| 30 | 30 | ); |
| 31 | 31 | |
| 32 | + /** |
|
| 33 | + * @param string $property |
|
| 34 | + * @param string $attribute |
|
| 35 | + */ |
|
| 32 | 36 | protected function addChange($property, $attribute, $value, $callback = null) |
| 33 | 37 | { |
| 34 | 38 | if(!$this->isNew()){ |
@@ -21,6 +21,9 @@ |
||
| 21 | 21 | return $this->isReference; |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param boolean $isReference |
|
| 26 | + */ |
|
| 24 | 27 | public function setIsReference($isReference) |
| 25 | 28 | { |
| 26 | 29 | $this->isReference = $isReference; |
@@ -14,6 +14,9 @@ discard block |
||
| 14 | 14 | // Description |
| 15 | 15 | public $name; |
| 16 | 16 | |
| 17 | + /** |
|
| 18 | + * @param Schema $schema |
|
| 19 | + */ |
|
| 17 | 20 | public function __construct($name, $schema) |
| 18 | 21 | { |
| 19 | 22 | $this->name = $name; |
@@ -26,6 +29,9 @@ discard block |
||
| 26 | 29 | } |
| 27 | 30 | } |
| 28 | 31 | |
| 32 | + /** |
|
| 33 | + * @param boolean $isReference |
|
| 34 | + */ |
|
| 29 | 35 | public function setIsReference($isReference) |
| 30 | 36 | { |
| 31 | 37 | $this->isReference = $isReference; |
@@ -61,6 +61,9 @@ |
||
| 61 | 61 | Parameters::wrap($table['columns'][$details['name']]) : false; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | + /** |
|
| 65 | + * @param string $type |
|
| 66 | + */ |
|
| 64 | 67 | private function doesItemExist($details, $type) |
| 65 | 68 | { |
| 66 | 69 | $table = $this->getTableDetails($details['schema'], $details['table']); |
@@ -24,8 +24,8 @@ |
||
| 24 | 24 | * THE SOFTWARE. |
| 25 | 25 | */ |
| 26 | 26 | |
| 27 | -use yentu\database\Table; |
|
| 28 | 27 | use yentu\database\Schema; |
| 28 | +use yentu\database\Table; |
|
| 29 | 29 | use yentu\exceptions\CommandException; |
| 30 | 30 | |
| 31 | 31 | function begin() |
@@ -180,6 +180,9 @@ discard block |
||
| 180 | 180 | ); |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | + /** |
|
| 184 | + * @param string $type |
|
| 185 | + */ |
|
| 183 | 186 | private function dropKeyItem($details, $type) { |
| 184 | 187 | $this->query( |
| 185 | 188 | sprintf( |
@@ -242,6 +245,9 @@ discard block |
||
| 242 | 245 | return "\"$identifier\""; |
| 243 | 246 | } |
| 244 | 247 | |
| 248 | + /** |
|
| 249 | + * @param string $direction |
|
| 250 | + */ |
|
| 245 | 251 | public function convertTypes($type, $direction, $length = null) { |
| 246 | 252 | $types = array( |
| 247 | 253 | 'integer' => 'integer', |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | /** |
| 97 | 97 | * Generate the query for a foreign key constraint. |
| 98 | 98 | * |
| 99 | - * @param array<array> $constraintDetails |
|
| 99 | + * @param array<array> $constraints |
|
| 100 | 100 | * @return string |
| 101 | 101 | */ |
| 102 | 102 | private function getFKConstraintQuery($constraints, $options) |
@@ -375,6 +375,9 @@ discard block |
||
| 375 | 375 | $this->query("DROP VIEW `{$details['name']}`"); |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | + /** |
|
| 379 | + * @param string $direction |
|
| 380 | + */ |
|
| 378 | 381 | public function convertTypes($type, $direction, $length) |
| 379 | 382 | { |
| 380 | 383 | $destinationType = null; |