|
@@ -76,6 +76,7 @@ class AnnotationDriver implements DriverInterface
|
|
$exclusionPolicy = 'NONE';
|
|
$exclusionPolicy = 'NONE';
|
|
$excludeAll = false;
|
|
$excludeAll = false;
|
|
$classAccessType = PropertyMetadata::ACCESS_TYPE_PROPERTY;
|
|
$classAccessType = PropertyMetadata::ACCESS_TYPE_PROPERTY;
|
|
|
|
+ $readOnlyClass = false;
|
|
foreach ($this->reader->getClassAnnotations($class) as $annot) {
|
|
foreach ($this->reader->getClassAnnotations($class) as $annot) {
|
|
if ($annot instanceof ExclusionPolicy) {
|
|
if ($annot instanceof ExclusionPolicy) {
|
|
$exclusionPolicy = $annot->policy;
|
|
$exclusionPolicy = $annot->policy;
|
|
@@ -87,6 +88,8 @@ class AnnotationDriver implements DriverInterface
|
|
$excludeAll = true;
|
|
$excludeAll = true;
|
|
} elseif ($annot instanceof AccessType) {
|
|
} elseif ($annot instanceof AccessType) {
|
|
$classAccessType = $annot->type;
|
|
$classAccessType = $annot->type;
|
|
|
|
+ } elseif ($annot instanceof ReadOnly) {
|
|
|
|
+ $readOnlyClass = true;
|
|
} elseif ($annot instanceof AccessorOrder) {
|
|
} elseif ($annot instanceof AccessorOrder) {
|
|
$classMetadata->setAccessorOrder($annot->order, $annot->custom);
|
|
$classMetadata->setAccessorOrder($annot->order, $annot->custom);
|
|
} elseif ($annot instanceof Discriminator) {
|
|
} elseif ($annot instanceof Discriminator) {
|
|
@@ -137,7 +140,7 @@ class AnnotationDriver implements DriverInterface
|
|
}
|
|
}
|
|
|
|
|
|
foreach ($propertiesMetadata as $propertyKey => $propertyMetadata) {
|
|
foreach ($propertiesMetadata as $propertyKey => $propertyMetadata) {
|
|
-
|
|
|
|
|
|
+ $propertyMetadata->readOnly = $propertyMetadata->readOnly || $readOnlyClass;
|
|
$isExclude = false;
|
|
$isExclude = false;
|
|
$isExpose = $propertyMetadata instanceof VirtualPropertyMetadata;
|
|
$isExpose = $propertyMetadata instanceof VirtualPropertyMetadata;
|
|
$accessType = $classAccessType;
|
|
$accessType = $classAccessType;
|