Explorar o código

Do not ask for setter if the property is defined as @ReadOnly

Amal Raghav %!s(int64=13) %!d(string=hai) anos
pai
achega
528620884e
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      Metadata/PropertyMetadata.php

+ 1 - 1
Metadata/PropertyMetadata.php

@@ -56,7 +56,7 @@ class PropertyMetadata extends BasePropertyMetadata
                 }
             }
 
-            if (empty($setter)) {
+            if (empty($setter) && !$this->readOnly) {
                 if ($class->hasMethod('set'.$this->name) && $class->getMethod('set'.$this->name)->isPublic()) {
                     $setter = 'set'.$this->name;
                 } else {