|
@@ 339-346 (lines=8) @@
|
| 336 |
|
|
| 337 |
|
private static function registerProperty(PhpClass $class, $name, $description, $type) |
| 338 |
|
{ |
| 339 |
|
if (!$class->hasProperty($name)) { |
| 340 |
|
$property = PhpProperty::create($name); |
| 341 |
|
$property->setDescription($description); |
| 342 |
|
$property->setType($type); |
| 343 |
|
$property->setVisibility('protected'); |
| 344 |
|
|
| 345 |
|
$class->setProperty($property); |
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
$isDirtyName = 'dirty'.ucfirst($name); |
| 349 |
|
if (!$class->hasProperty($isDirtyName)) { |
|
@@ 349-357 (lines=9) @@
|
| 346 |
|
} |
| 347 |
|
|
| 348 |
|
$isDirtyName = 'dirty'.ucfirst($name); |
| 349 |
|
if (!$class->hasProperty($isDirtyName)) { |
| 350 |
|
$dirtyProperty = PhpProperty::create($isDirtyName); |
| 351 |
|
$dirtyProperty->setDescription("Whether '$name' has been changed or not."); |
| 352 |
|
$dirtyProperty->setType('bool'); |
| 353 |
|
$dirtyProperty->setVisibility('protected'); |
| 354 |
|
$dirtyProperty->setDefaultValue(false); |
| 355 |
|
|
| 356 |
|
$class->setProperty($dirtyProperty); |
| 357 |
|
} |
| 358 |
|
|
| 359 |
|
$getterName = 'get'.ucfirst($name); |
| 360 |
|
$getterDescription = 'Get '.lcfirst($description); |