Example #1
0
 public function changeValue($value)
 {
     if (null !== $value && !$this->type->isValid($value)) {
         throw new InvalidArgumentException(sprintf('Invalid value for field "%s"', $this->name));
     }
     $this->value = $this->type->reverseTransform($value);
 }
 /**
  * @param  Type $type
  */
 public function addType(Type $type)
 {
     $this->types[$type->getName()] = $type;
 }