@@ 145-167 (lines=23) @@ | ||
142 | ||
143 | $possibleFileName = $this->configuration->getPathFinder()->getPath($beannamespace.'\\'.$className)->getPathname(); |
|
144 | ||
145 | if (!file_exists($possibleFileName)) { |
|
146 | $tableName = $table->getName(); |
|
147 | $str = "<?php |
|
148 | /* |
|
149 | * This file has been automatically generated by TDBM. |
|
150 | * You can edit this file as it will not be overwritten. |
|
151 | */ |
|
152 | ||
153 | namespace {$beannamespace}; |
|
154 | ||
155 | use {$beannamespace}\\Generated\\{$baseClassName}; |
|
156 | ||
157 | /** |
|
158 | * The $className class maps the '$tableName' table in database. |
|
159 | */ |
|
160 | class $className extends $baseClassName |
|
161 | { |
|
162 | } |
|
163 | "; |
|
164 | $this->ensureDirectoryExist($possibleFileName); |
|
165 | file_put_contents($possibleFileName, $str); |
|
166 | @chmod($possibleFileName, 0664); |
|
167 | } |
|
168 | } |
|
169 | ||
170 | /** |
|
@@ 440-463 (lines=24) @@ | ||
437 | $possibleFileName = $this->configuration->getPathFinder()->getPath($daonamespace.'\\'.$className)->getPathname(); |
|
438 | ||
439 | // Now, let's generate the "editable" class |
|
440 | if (!file_exists($possibleFileName)) { |
|
441 | $str = "<?php |
|
442 | ||
443 | /* |
|
444 | * This file has been automatically generated by TDBM. |
|
445 | * You can edit this file as it will not be overwritten. |
|
446 | */ |
|
447 | ||
448 | namespace {$daonamespace}; |
|
449 | ||
450 | use {$daonamespace}\\Generated\\{$baseClassName}; |
|
451 | ||
452 | /** |
|
453 | * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table. |
|
454 | */ |
|
455 | class $className extends $baseClassName |
|
456 | { |
|
457 | } |
|
458 | "; |
|
459 | $this->ensureDirectoryExist($possibleFileName); |
|
460 | file_put_contents($possibleFileName, $str); |
|
461 | @chmod($possibleFileName, 0664); |
|
462 | } |
|
463 | } |
|
464 | ||
465 | /** |
|
466 | * Generates the factory bean. |