public function validate() { if (!in_array($this->type, ['I', 'S'])) { throw new CoinfideException('Type of OrderItem must be one of "I" (item), "S" (shipping)'); } parent::validate(); }
public function validate() { parent::validate(); if (!($this->fullNumber || $this->number && $this->countryCode)) { throw new CoinfideException(sprintf('Please set either fullNumber or number AND countryCode for Phone object')); } }