| @@ 191-212 (lines=22) @@ | ||
| 188 | } |
|
| 189 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
| 190 | ||
| 191 | if (!file_exists($possibleFileName)) { |
|
| 192 | $tableName = $table->getName(); |
|
| 193 | ||
| 194 | $str = "<?php |
|
| 195 | /* |
|
| 196 | * This file has been automatically generated by TDBM. |
|
| 197 | * You can edit this file as it will not be overwritten. |
|
| 198 | */ |
|
| 199 | ||
| 200 | namespace {$beannamespace}; |
|
| 201 | ||
| 202 | /** |
|
| 203 | * The $className class maps the '$tableName' table in database. |
|
| 204 | */ |
|
| 205 | class $className extends $baseClassName |
|
| 206 | { |
|
| 207 | ||
| 208 | }"; |
|
| 209 | $this->ensureDirectoryExist($possibleFileName); |
|
| 210 | file_put_contents($possibleFileName ,$str); |
|
| 211 | @chmod($possibleFileName, 0664); |
|
| 212 | } |
|
| 213 | } |
|
| 214 | ||
| 215 | /** |
|
| @@ 434-455 (lines=22) @@ | ||
| 431 | $possibleFileName = $this->rootPath.$possibleFileNames[0]; |
|
| 432 | ||
| 433 | // Now, let's generate the "editable" class |
|
| 434 | if (!file_exists($possibleFileName)) { |
|
| 435 | $str = "<?php |
|
| 436 | ||
| 437 | /* |
|
| 438 | * This file has been automatically generated by TDBM. |
|
| 439 | * You can edit this file as it will not be overwritten. |
|
| 440 | */ |
|
| 441 | ||
| 442 | namespace {$daonamespace}; |
|
| 443 | ||
| 444 | /** |
|
| 445 | * The $className class will maintain the persistence of $beanClassWithoutNameSpace class into the $tableName table. |
|
| 446 | */ |
|
| 447 | class $className extends $baseClassName |
|
| 448 | { |
|
| 449 | ||
| 450 | } |
|
| 451 | "; |
|
| 452 | $this->ensureDirectoryExist($possibleFileName); |
|
| 453 | file_put_contents($possibleFileName ,$str); |
|
| 454 | @chmod($possibleFileName, 0664); |
|
| 455 | } |
|
| 456 | } |
|
| 457 | ||
| 458 | ||