") */ public $items; public function __construct($weight = null, $width = null, $length = null, $height = null) { $this->weight = $weight; $this->width = $width; $this->length = $length; $this->height = $height; } public function getVolume() { if (null !== $this->length && null !== $this->width && null !== $this->height ) { return $this->length * $this->width * $this->height; } else { return false; } } public static function loadValidatorMetadata(ClassMetadata $metadata) { $metadata ->addPropertyConstraint('weight', new Assert\NotBlank()); } }