<?php
 namespace App\OfferProfileRules; class Criterion_FormOfPayment extends CriterionAbstract { public function checkFields(\App\OfferProfileRules\Fields $fields) { return $this->checkField($fields->offerFormOfPayment); } public function checkAssignedValues(\App\MessagesCollector $msgs) { if (($this->operation=='equal' or $this->operation=='notEqual') and !$this->values) { $msgs->addWarning("No form of payment set."); } else { $CFG = \Engine\Loader_Cfg::getInstance()->getGlobal(); foreach($this->values as $elem) { if (!in_array($elem, $CFG['offers']['formOfPaymentList'])) { $msgs->addWarning("The offer FOP `{$elem}` is not valid."); } } } } protected function createDescription_getEntityName($code) { $_LANG = \App\Loader_Lang::getInstance()->getAll(); return $_LANG['offers']['formOfPayment'][$code]; } } 