public function testSetGetValue()
 {
     $obj = new TestObject();
     $metadata = new PropertyMetadata('Metadata\\Tests\\Fixtures\\TestObject', 'foo');
     $this->assertNull($metadata->getValue($obj));
     $metadata->setValue($obj, 'foo');
     $this->assertEquals('foo', $metadata->getValue($obj));
 }
 public function __construct($class, $name, $type, $role, $group, array $options)
 {
     parent::__construct($class, $name);
     $this->type = $type;
     $this->role = $role;
     $this->group = $group;
     $this->options = FieldOptions::create($options);
 }
 public function __construct($class, $name, $valueObjectClass, $fieldPrefix)
 {
     parent::__construct($class, $name);
     if (!class_exists($valueObjectClass)) {
         throw new \InvalidArgumentException(sprintf('Value object class "%s" does not exist', $valueObjectClass));
     }
     $this->valueObjectClass = $valueObjectClass;
     if ($fieldPrefix === null) {
         $fieldPrefix = $name . '_';
     }
     $this->fieldPrefix = $fieldPrefix;
 }
Example #4
0
 /**
  * PropertyMetadata constructor.
  *
  * @param string $class
  * @param string $name
  * @param string $namespace
  */
 public function __construct($class, $name, $namespace)
 {
     parent::__construct($class, $name);
     $this->namespace = $namespace;
 }
Example #5
0
 public function unserialize($str)
 {
     list($this->sinceVersion, $this->untilVersion, $this->groups, $this->serializedName, $this->type, $this->xmlCollection, $this->xmlCollectionInline, $this->xmlEntryName, $this->xmlKeyAttribute, $this->xmlAttribute, $this->xmlValue, $this->xmlNamespace, $this->xmlCollectionEntry, $this->xmlKeyValuePairs, $this->xmlElementCData, $this->getter, $this->setter, $this->inline, $this->readOnly, $this->xmlAttributeMap, $this->maxDepth, $parentStr) = unserialize($str);
     parent::unserialize($parentStr);
 }
Example #6
0
 /**
  * {@inheritdoc}
  */
 public function unserialize($str)
 {
     list($this->isCollection, $this->method, $parentStr) = unserialize($str);
     parent::unserialize($parentStr);
 }
Example #7
0
 /**
  * Deserializes the current propertymetadata.
  *
  * @param string $str
  */
 public function unserialize($str)
 {
     list($this->type, $this->innerType, $this->collectionMergeStrategy, $this->emptyValueStrategy, $this->ignoreNullValue, $parentStr) = unserialize($str);
     parent::unserialize($parentStr);
 }
 public function unserialize($str)
 {
     list($this->sinceVersion, $this->untilVersion, $this->groups, $this->serializedName, $this->type, $this->xmlCollection, $this->xmlCollectionInline, $this->xmlEntryName, $this->xmlKeyAttribute, $this->xmlAttribute, $this->xmlValue, $this->getter, $this->setter, $this->inline, $this->readOnly, $parentStr) = unserialize($str);
     parent::unserialize($parentStr);
 }
 public function unserialize($str)
 {
     list($this->filters, $parentStr) = unserialize($str);
     parent::unserialize($parentStr);
 }
 public function unserialize($str)
 {
     $unserialized = unserialize($str);
     list($this->sinceVersion, $this->untilVersion, $this->groups, $this->serializedName, $this->type, $this->xmlCollection, $this->xmlCollectionInline, $this->xmlEntryName, $this->xmlKeyAttribute, $this->xmlAttribute, $this->xmlValue, $this->xmlNamespace, $this->xmlKeyValuePairs, $this->xmlElementCData, $this->getter, $this->setter, $this->inline, $this->readOnly, $this->xmlAttributeMap, $this->maxDepth, $parentStr) = $unserialized;
     if (isset($unserialized['xmlEntryNamespace'])) {
         $this->xmlEntryNamespace = $unserialized['xmlEntryNamespace'];
     }
     if (isset($unserialized['xmlCollectionSkipWhenEmpty'])) {
         $this->xmlCollectionSkipWhenEmpty = $unserialized['xmlCollectionSkipWhenEmpty'];
     }
     parent::unserialize($parentStr);
 }
Example #11
0
 /**
  * {@inheritdoc}
  */
 public function unserialize($str)
 {
     list($this->defaultValues, $this->mode, $parentStr) = unserialize($str);
     parent::unserialize($parentStr);
 }
 public function unserialize($str)
 {
     list($this->exclusionExpression, $parentStr) = unserialize($str);
     parent::unserialize($parentStr);
 }