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