@@ -298,8 +298,8 @@ |
||
298 | 298 | public function getSequence ( $table , $column ) |
299 | 299 | { |
300 | 300 | $return = $this->getPDO () |
301 | - ->query ( "select * from information_schema.columns where extra like '%auto_increment%' and TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';" ) |
|
302 | - ->fetch ( \PDO::FETCH_ASSOC ); |
|
301 | + ->query ( "select * from information_schema.columns where extra like '%auto_increment%' and TABLE_SCHEMA='{$this->database}' AND TABLE_NAME='{$table}' AND COLUMN_NAME='{$column}';" ) |
|
302 | + ->fetch ( \PDO::FETCH_ASSOC ); |
|
303 | 303 | |
304 | 304 | if ( ! $return ) |
305 | 305 | { |
@@ -247,7 +247,7 @@ |
||
247 | 247 | { |
248 | 248 | $pdo = $this->getPDO (); |
249 | 249 | $return1 = $pdo->query ( "SELECT pg_get_serial_sequence('$table', '$column');" ) |
250 | - ->fetchColumn (); |
|
250 | + ->fetchColumn (); |
|
251 | 251 | |
252 | 252 | if ( $return1 ) |
253 | 253 | { |
@@ -19,6 +19,6 @@ |
||
19 | 19 | |
20 | 20 | public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable ) |
21 | 21 | { |
22 | - return array(); |
|
22 | + return array(); |
|
23 | 23 | } |
24 | 24 | } |
@@ -117,7 +117,7 @@ |
||
117 | 117 | */ |
118 | 118 | public function isOverwrite () |
119 | 119 | { |
120 | - return $this->overwrite; |
|
120 | + return $this->overwrite; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | } |
@@ -178,14 +178,14 @@ |
||
178 | 178 | public function createDependece ( $constraint_name , $table_name , $column_name , $schema = null ) |
179 | 179 | { |
180 | 180 | $objConstrantDependence = Constrant::getInstance () |
181 | - ->populate ( |
|
182 | - array ( |
|
183 | - 'constrant' => $constraint_name , |
|
184 | - 'schema' => $schema , |
|
185 | - 'table' => $table_name , |
|
186 | - 'column' => $column_name |
|
187 | - ) |
|
188 | - ); |
|
181 | + ->populate ( |
|
182 | + array ( |
|
183 | + 'constrant' => $constraint_name , |
|
184 | + 'schema' => $schema , |
|
185 | + 'table' => $table_name , |
|
186 | + 'column' => $column_name |
|
187 | + ) |
|
188 | + ); |
|
189 | 189 | |
190 | 190 | $this->addDependece ( $objConstrantDependence ); |
191 | 191 |
@@ -107,31 +107,31 @@ discard block |
||
107 | 107 | if ( $table->hasColumn ( $constrant[ "column_name" ] ) ) |
108 | 108 | { |
109 | 109 | $objConstrant = Constrant::getInstance () |
110 | - ->populate ( |
|
111 | - array ( |
|
112 | - 'constrant' => $constrant[ 'constraint_name' ] , |
|
113 | - 'schema' => $constrant[ 'foreign_schema' ] , |
|
114 | - 'table' => $constrant[ 'foreign_table' ] , |
|
115 | - 'column' => $constrant[ 'foreign_column' ] |
|
116 | - ) |
|
117 | - ); |
|
110 | + ->populate ( |
|
111 | + array ( |
|
112 | + 'constrant' => $constrant[ 'constraint_name' ] , |
|
113 | + 'schema' => $constrant[ 'foreign_schema' ] , |
|
114 | + 'table' => $constrant[ 'foreign_table' ] , |
|
115 | + 'column' => $constrant[ 'foreign_column' ] |
|
116 | + ) |
|
117 | + ); |
|
118 | 118 | |
119 | 119 | switch ( $constrant[ 'constraint_type' ] ) |
120 | 120 | { |
121 | 121 | case "FOREIGN KEY": |
122 | 122 | $table->getColumn ( $constrant[ "column_name" ] ) |
123 | - ->addRefFk ( $objConstrant ); |
|
123 | + ->addRefFk ( $objConstrant ); |
|
124 | 124 | break; |
125 | 125 | case"PRIMARY KEY": |
126 | 126 | $table->getColumn ( $constrant[ "column_name" ] ) |
127 | - ->setPrimaryKey ( $objConstrant ) |
|
128 | - ->setSequence ( |
|
129 | - $this->getSequence ( |
|
130 | - $table_name , |
|
131 | - $constrant[ "column_name" ], |
|
132 | - $schema |
|
133 | - ) |
|
134 | - ); |
|
127 | + ->setPrimaryKey ( $objConstrant ) |
|
128 | + ->setSequence ( |
|
129 | + $this->getSequence ( |
|
130 | + $table_name , |
|
131 | + $constrant[ "column_name" ], |
|
132 | + $schema |
|
133 | + ) |
|
134 | + ); |
|
135 | 135 | break; |
136 | 136 | } |
137 | 137 | } |
@@ -151,12 +151,12 @@ discard block |
||
151 | 151 | if ( $table->hasColumn ( $constrant[ "foreign_column" ] ) ) |
152 | 152 | { |
153 | 153 | $table->getColumn ( $constrant[ "foreign_column" ] ) |
154 | - ->createDependece ( |
|
155 | - $constrant[ 'constraint_name' ] , |
|
156 | - $constrant[ 'table_name' ] , |
|
157 | - $constrant[ 'column_name' ] , |
|
158 | - $constrant[ 'table_schema' ] |
|
159 | - ); |
|
154 | + ->createDependece ( |
|
155 | + $constrant[ 'constraint_name' ] , |
|
156 | + $constrant[ 'table_name' ] , |
|
157 | + $constrant[ 'column_name' ] , |
|
158 | + $constrant[ 'table_schema' ] |
|
159 | + ); |
|
160 | 160 | } |
161 | 161 | } |
162 | 162 | } |
@@ -191,10 +191,10 @@ discard block |
||
191 | 191 | ); |
192 | 192 | |
193 | 193 | $this->getTable ( $key , $schema ) |
194 | - ->addColumn ( $column ) |
|
195 | - ->setNamespace ( |
|
196 | - $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) ) |
|
197 | - ); |
|
194 | + ->addColumn ( $column ) |
|
195 | + ->setNamespace ( |
|
196 | + $this->config->createClassNamespace ( $this->getTable ( $key , $schema ) ) |
|
197 | + ); |
|
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
@@ -254,13 +254,13 @@ discard block |
||
254 | 254 | public function createTable ( $nameTable , $schema = 0 ) |
255 | 255 | { |
256 | 256 | $this->objDbTables[ $schema ][ trim ( $nameTable ) ] = DbTable::getInstance () |
257 | - ->populate ( |
|
258 | - array ( |
|
259 | - 'table' => $nameTable , |
|
260 | - 'schema' => $schema , |
|
261 | - 'database' => $this->database |
|
262 | - ) |
|
263 | - ); |
|
257 | + ->populate ( |
|
258 | + array ( |
|
259 | + 'table' => $nameTable , |
|
260 | + 'schema' => $schema , |
|
261 | + 'database' => $this->database |
|
262 | + ) |
|
263 | + ); |
|
264 | 264 | |
265 | 265 | return $this; |
266 | 266 | } |
@@ -62,8 +62,8 @@ discard block |
||
62 | 62 | $parents[] = array ( |
63 | 63 | 'class' => $makerFile->getConfig () |
64 | 64 | ->createClassNamespace ( $constrant ) |
65 | - . ZendFrameworkOne::SEPARETOR |
|
66 | - . AbstractMaker::getClassName ( $constrant->getTable () ) , |
|
65 | + . ZendFrameworkOne::SEPARETOR |
|
66 | + . AbstractMaker::getClassName ( $constrant->getTable () ) , |
|
67 | 67 | 'function' => AbstractMaker::getClassName ( $name ) , |
68 | 68 | 'table' => $constrant->getTable () , |
69 | 69 | 'column' => $objColumn->getName () , |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | $depends[] = array ( |
104 | 104 | 'class' => $makerFile->getConfig () |
105 | 105 | ->createClassNamespace ( $dependence ) |
106 | - . ZendFrameworkOne::SEPARETOR |
|
107 | - . AbstractMaker::getClassName ( $dependence->getTable () ) , |
|
106 | + . ZendFrameworkOne::SEPARETOR |
|
107 | + . AbstractMaker::getClassName ( $dependence->getTable () ) , |
|
108 | 108 | 'function' => AbstractMaker::getClassName ( $name ) , |
109 | 109 | 'table' => $dependence->getTable () , |
110 | 110 | 'column' => $dependence->getColumn () , |
@@ -19,6 +19,6 @@ |
||
19 | 19 | |
20 | 20 | public function parseRelation ( \Classes\MakerFile $makerFile, \Classes\Db\DbTable $dbTable ) |
21 | 21 | { |
22 | - return array(); |
|
22 | + return array(); |
|
23 | 23 | } |
24 | 24 | } |