") */ 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 (!is_null($this->length) && !is_null($this->width) && !is_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()); } }