<?php
 namespace App\OfferProfileRules; class Criterion_ItineraryServiceClassCode extends CriterionAbstract { public function checkFields(\App\OfferProfileRules\Fields $fields) { return $this->checkField($fields->serviceClassCode); } public function checkAssignedValues(\App\MessagesCollector $msgs) { if (($this->operation=='equal' or $this->operation=='notEqual') and !$this->values) { $msgs->addWarning("No class code set."); } else { foreach($this->values as $elem) { if (!$elem) { $msgs->addWarning("You cannot set an empty service class code."); } } } } protected function createDescription_getEntityName($code) { return $code; } } 