checkValueStructure() protected method

Throws an exception if value structure is not of expected format.
protected checkValueStructure ( Value $value )
$value eZ\Publish\Core\FieldType\Value
Example #1
0
 /**
  * Throws an exception if value structure is not of expected format.
  *
  * @throws \eZ\Publish\API\Repository\Exceptions\InvalidArgumentException If the value does not match the expected structure.
  *
  * @param \eZ\Publish\Core\FieldType\Media\Value $value
  */
 protected function checkValueStructure(BaseValue $value)
 {
     parent::checkValueStructure($value);
     if (!is_bool($value->hasController)) {
         throw new InvalidArgumentType('$value->hasController', 'bool', $value->hasController);
     }
     if (!is_bool($value->autoplay)) {
         throw new InvalidArgumentType('$value->autoplay', 'bool', $value->autoplay);
     }
     if (!is_bool($value->loop)) {
         throw new InvalidArgumentType('$value->loop', 'bool', $value->loop);
     }
     if (!is_int($value->height)) {
         throw new InvalidArgumentType('$value->height', 'int', $value->height);
     }
     if (!is_int($value->width)) {
         throw new InvalidArgumentType('$value->width', 'int', $value->width);
     }
 }