@@ 477-500 (lines=24) @@ | ||
474 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
475 | ||
476 | // Now, let's generate the "editable" class |
|
477 | if (!file_exists($possibleFileName)) { |
|
478 | $str = "<?php |
|
479 | ||
480 | /* |
|
481 | * This file has been automatically generated by TDBM. |
|
482 | * You can edit this file as it will not be overwritten. |
|
483 | */ |
|
484 | ||
485 | namespace {$daonamespace}; |
|
486 | ||
487 | use {$daonamespace}\\Generated\\{$baseClassName}; |
|
488 | ||
489 | /** |
|
490 | * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table. |
|
491 | */ |
|
492 | class $className extends $baseClassName |
|
493 | { |
|
494 | } |
|
495 | "; |
|
496 | $this->ensureDirectoryExist($possibleFileName); |
|
497 | file_put_contents($possibleFileName, $str); |
|
498 | @chmod($possibleFileName, 0664); |
|
499 | } |
|
500 | } |
|
501 | ||
502 | /** |
|
503 | * Generates the factory bean. |
|
@@ 169-191 (lines=23) @@ | ||
166 | // @codeCoverageIgnoreEnd |
|
167 | } |
|
168 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
169 | if (!file_exists($possibleFileName)) { |
|
170 | $tableName = $table->getName(); |
|
171 | $str = "<?php |
|
172 | /* |
|
173 | * This file has been automatically generated by TDBM. |
|
174 | * You can edit this file as it will not be overwritten. |
|
175 | */ |
|
176 | ||
177 | namespace {$beannamespace}; |
|
178 | ||
179 | use {$beannamespace}\\Generated\\{$baseClassName}; |
|
180 | ||
181 | /** |
|
182 | * The $className class maps the '$tableName' table in database. |
|
183 | */ |
|
184 | class $className extends $baseClassName |
|
185 | { |
|
186 | } |
|
187 | "; |
|
188 | $this->ensureDirectoryExist($possibleFileName); |
|
189 | file_put_contents($possibleFileName, $str); |
|
190 | @chmod($possibleFileName, 0664); |
|
191 | } |
|
192 | } |
|
193 | ||
194 | /** |