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