*/
public $groups = array();
+ /**
+ * @var int|null
+ *
+ * @internal This property is public in order to reduce the size of the
+ * class' serialized representation. Do not access it. Use
+ * {@link getMaxDepth()} instead.
+ */
+ public $maxDepth;
+
/**
* Constructs a metadata for the given attribute.
*
return $this->groups;
}
+ /**
+ * {@inheritdoc}
+ */
+ public function setMaxDepth($maxDepth)
+ {
+ $this->maxDepth = $maxDepth;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getMaxDepth()
+ {
+ return $this->maxDepth;
+ }
+
/**
* {@inheritdoc}
*/
foreach ($attributeMetadata->getGroups() as $group) {
$this->addGroup($group);
}
+
+ // Overwrite only if not defined
+ if (null === $this->maxDepth) {
+ $this->maxDepth = $attributeMetadata->getMaxDepth();
+ }
}
/**
*/
public function __sleep()
{
- return array('name', 'groups');
+ return array('name', 'groups', 'maxDepth');
}
}