| @@ 206-227 (lines=22) @@ | ||
| 203 | } |
|
| 204 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
| 205 | ||
| 206 | if (!file_exists($possibleFileName)) { |
|
| 207 | $tableName = $table->getName(); |
|
| 208 | ||
| 209 | $str = "<?php |
|
| 210 | /* |
|
| 211 | * This file has been automatically generated by TDBM. |
|
| 212 | * You can edit this file as it will not be overwritten. |
|
| 213 | */ |
|
| 214 | ||
| 215 | namespace {$beannamespace}; |
|
| 216 | ||
| 217 | /** |
|
| 218 | * The $className class maps the '$tableName' table in database. |
|
| 219 | */ |
|
| 220 | class $className extends $baseClassName |
|
| 221 | { |
|
| 222 | ||
| 223 | }"; |
|
| 224 | $this->ensureDirectoryExist($possibleFileName); |
|
| 225 | file_put_contents($possibleFileName, $str); |
|
| 226 | @chmod($possibleFileName, 0664); |
|
| 227 | } |
|
| 228 | } |
|
| 229 | ||
| 230 | /** |
|
| @@ 461-482 (lines=22) @@ | ||
| 458 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
| 459 | ||
| 460 | // Now, let's generate the "editable" class |
|
| 461 | if (!file_exists($possibleFileName)) { |
|
| 462 | $str = "<?php |
|
| 463 | ||
| 464 | /* |
|
| 465 | * This file has been automatically generated by TDBM. |
|
| 466 | * You can edit this file as it will not be overwritten. |
|
| 467 | */ |
|
| 468 | ||
| 469 | namespace {$daonamespace}; |
|
| 470 | ||
| 471 | /** |
|
| 472 | * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table. |
|
| 473 | */ |
|
| 474 | class $className extends $baseClassName |
|
| 475 | { |
|
| 476 | ||
| 477 | } |
|
| 478 | "; |
|
| 479 | $this->ensureDirectoryExist($possibleFileName); |
|
| 480 | file_put_contents($possibleFileName, $str); |
|
| 481 | @chmod($possibleFileName, 0664); |
|
| 482 | } |
|
| 483 | } |
|
| 484 | ||
| 485 | /** |
|