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