Browse Source

Added support for virtual properties when the exclusion policy is set to "all" by making them allways exposed by default.

Roger Llopart Pla 13 years ago
parent
commit
87cb5b650b

+ 2 - 1
Metadata/Driver/AnnotationDriver.php

@@ -122,7 +122,8 @@ class AnnotationDriver implements DriverInterface
 
             foreach ($propertiesMetadata as $propertyKey => $propertyMetadata) {
 
-                $isExclude = $isExpose = false;
+                $isExclude = false;
+                $isExpose = $propertyMetadata instanceof VirtualPropertyMetadata;
                 $AccessType = $classAccessType;
                 $accessor = array(null, null);
 

+ 2 - 1
Metadata/Driver/XmlDriver.php

@@ -88,7 +88,8 @@ class XmlDriver extends AbstractFileDriver
 
             foreach ($propertiesMetadata as $propertyKey => $pMetadata) {
 
-                $isExclude = $isExpose = false;
+                $isExclude = false;
+                $isExpose = $pMetadata instanceof VirtualPropertyMetadata;
 
                 $pElem = $propertiesNodes[$propertyKey];
                 if (!empty( $pElem )) {

+ 3 - 1
Metadata/Driver/YamlDriver.php

@@ -81,7 +81,9 @@ class YamlDriver extends AbstractFileDriver
 
             foreach ($propertiesMetadata as $pName => $pMetadata) {
 
-                $isExclude = $isExpose = false;
+                $isExclude = false;
+                $isExpose = $pMetadata instanceof VirtualPropertyMetadata;
+
                 if (isset($config['properties'][$pName])) {
                     $pConfig = $config['properties'][$pName];