<?php
 namespace App\OfferProfileRules; class Criterion_ItineraryTripType extends CriterionAbstract { public function checkFields(\App\OfferProfileRules\Fields $fields) { return $this->checkField($fields->flightType); } public function checkAssignedValues(\App\MessagesCollector $msgs) { if (($this->operation=='equal' or $this->operation=='notEqual') and !$this->values) { $msgs->addWarning("No trip type set."); } else { foreach($this->values as $elem) { if (!in_array($elem, ['OW', 'RT', 'SJ', 'DJ'])) { $msgs->addWarning("The itinerary trip type `{$elem}` is not valid."); } } } } protected function createDescription_getEntityName($code) { return $code; } } 