@@ 212-233 (lines=22) @@ | ||
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 | /** |
|
223 | * The $className class maps the '$tableName' table in database. |
|
224 | */ |
|
225 | class $className extends $baseClassName |
|
226 | { |
|
227 | ||
228 | }"; |
|
229 | $this->ensureDirectoryExist($possibleFileName); |
|
230 | file_put_contents($possibleFileName, $str); |
|
231 | @chmod($possibleFileName, 0664); |
|
232 | } |
|
233 | } |
|
234 | ||
235 | /** |
|
236 | * Tries to find a @defaultSort annotation in one of the columns. |
|
@@ 476-497 (lines=22) @@ | ||
473 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
474 | ||
475 | // Now, let's generate the "editable" class |
|
476 | if (!file_exists($possibleFileName)) { |
|
477 | $str = "<?php |
|
478 | ||
479 | /* |
|
480 | * This file has been automatically generated by TDBM. |
|
481 | * You can edit this file as it will not be overwritten. |
|
482 | */ |
|
483 | ||
484 | namespace {$daonamespace}; |
|
485 | ||
486 | /** |
|
487 | * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table. |
|
488 | */ |
|
489 | class $className extends $baseClassName |
|
490 | { |
|
491 | ||
492 | } |
|
493 | "; |
|
494 | $this->ensureDirectoryExist($possibleFileName); |
|
495 | file_put_contents($possibleFileName, $str); |
|
496 | @chmod($possibleFileName, 0664); |
|
497 | } |
|
498 | } |
|
499 | ||
500 | /** |