@@ 199-220 (lines=22) @@ | ||
196 | } |
|
197 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
198 | ||
199 | if (!file_exists($possibleFileName)) { |
|
200 | $tableName = $table->getName(); |
|
201 | ||
202 | $str = "<?php |
|
203 | /* |
|
204 | * This file has been automatically generated by TDBM. |
|
205 | * You can edit this file as it will not be overwritten. |
|
206 | */ |
|
207 | ||
208 | namespace {$beannamespace}; |
|
209 | ||
210 | /** |
|
211 | * The $className class maps the '$tableName' table in database. |
|
212 | */ |
|
213 | class $className extends $baseClassName |
|
214 | { |
|
215 | ||
216 | }"; |
|
217 | $this->ensureDirectoryExist($possibleFileName); |
|
218 | file_put_contents($possibleFileName, $str); |
|
219 | @chmod($possibleFileName, 0664); |
|
220 | } |
|
221 | } |
|
222 | ||
223 | /** |
|
@@ 443-464 (lines=22) @@ | ||
440 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
441 | ||
442 | // Now, let's generate the "editable" class |
|
443 | if (!file_exists($possibleFileName)) { |
|
444 | $str = "<?php |
|
445 | ||
446 | /* |
|
447 | * This file has been automatically generated by TDBM. |
|
448 | * You can edit this file as it will not be overwritten. |
|
449 | */ |
|
450 | ||
451 | namespace {$daonamespace}; |
|
452 | ||
453 | /** |
|
454 | * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table. |
|
455 | */ |
|
456 | class $className extends $baseClassName |
|
457 | { |
|
458 | ||
459 | } |
|
460 | "; |
|
461 | $this->ensureDirectoryExist($possibleFileName); |
|
462 | file_put_contents($possibleFileName, $str); |
|
463 | @chmod($possibleFileName, 0664); |
|
464 | } |
|
465 | } |
|
466 | ||
467 | /** |