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