@@ 212-234 (lines=23) @@ | ||
209 | // @codeCoverageIgnoreEnd |
|
210 | } |
|
211 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
212 | if (!file_exists($possibleFileName)) { |
|
213 | $tableName = $table->getName(); |
|
214 | $str = "<?php |
|
215 | /* |
|
216 | * This file has been automatically generated by TDBM. |
|
217 | * You can edit this file as it will not be overwritten. |
|
218 | */ |
|
219 | ||
220 | namespace {$beannamespace}; |
|
221 | ||
222 | use {$beannamespace}\\Generated\\{$baseClassName}; |
|
223 | ||
224 | /** |
|
225 | * The $className class maps the '$tableName' table in database. |
|
226 | */ |
|
227 | class $className extends $baseClassName |
|
228 | { |
|
229 | ||
230 | }"; |
|
231 | $this->ensureDirectoryExist($possibleFileName); |
|
232 | file_put_contents($possibleFileName, $str); |
|
233 | @chmod($possibleFileName, 0664); |
|
234 | } |
|
235 | } |
|
236 | ||
237 | /** |
|
@@ 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 | "; |
|
498 | $this->ensureDirectoryExist($possibleFileName); |
|
499 | file_put_contents($possibleFileName, $str); |
|
500 | @chmod($possibleFileName, 0664); |
|
501 | } |
|
502 | } |
|
503 | ||
504 | /** |