|
@@ 399-406 (lines=8) @@
|
| 396 |
|
|
| 397 |
|
private static function registerProperty(PhpClass $class, $name, $description, $type, $nullable = false) |
| 398 |
|
{ |
| 399 |
|
if (!$class->hasProperty($name)) { |
| 400 |
|
$property = PhpProperty::create($name); |
| 401 |
|
$property->setDescription($description); |
| 402 |
|
$property->setType($type); |
| 403 |
|
$property->setVisibility('protected'); |
| 404 |
|
|
| 405 |
|
$class->setProperty($property); |
| 406 |
|
} |
| 407 |
|
|
| 408 |
|
$isDirtyName = 'dirty'.ucfirst($name); |
| 409 |
|
if (!$class->hasProperty($isDirtyName)) { |
|
@@ 409-417 (lines=9) @@
|
| 406 |
|
} |
| 407 |
|
|
| 408 |
|
$isDirtyName = 'dirty'.ucfirst($name); |
| 409 |
|
if (!$class->hasProperty($isDirtyName)) { |
| 410 |
|
$dirtyProperty = PhpProperty::create($isDirtyName); |
| 411 |
|
$dirtyProperty->setDescription("Whether '$name' has been changed or not."); |
| 412 |
|
$dirtyProperty->setType('bool'); |
| 413 |
|
$dirtyProperty->setVisibility('protected'); |
| 414 |
|
$dirtyProperty->setDefaultValue(false); |
| 415 |
|
|
| 416 |
|
$class->setProperty($dirtyProperty); |
| 417 |
|
} |
| 418 |
|
|
| 419 |
|
$getterName = 'get'.ucfirst($name); |
| 420 |
|
$getterDescription = 'Get '.lcfirst($description); |