Example #1
0
 private function validateRequiredFields(Pass $pass)
 {
     if ($this->isBlankOrNull($pass->getDescription())) {
         $this->addError(self::DESCRIPTION_REQUIRED);
     }
     if ($pass->getFormatVersion() !== 1) {
         $this->addError(self::FORMAT_VERSION_REQUIRED);
     }
     if ($this->isBlankOrNull($pass->getOrganizationName())) {
         $this->addError(self::ORGANIZATION_NAME_REQUIRED);
     }
     if ($this->isBlankOrNull($pass->getPassTypeIdentifier())) {
         $this->addError(self::PASS_TYPE_IDENTIFIER_REQUIRED);
     }
     if ($this->isBlankOrNull($pass->getSerialNumber())) {
         $this->addError(self::SERIAL_NUMBER_REQUIRED);
     }
     if ($this->isBlankOrNull($pass->getTeamIdentifier())) {
         $this->addError(self::TEAM_IDENTIFIER_REQUIRED);
     }
 }