/** * mappableIfThen * @param LexiconMethod[] $true * @param LexiconMethod[] $false * @return ObjectInterface * @throws CatchableException */ public function mappableIfThen($true, $false = null) { if ($this->getModel()->getValue()) { $objectInterface = Parameter::parseLexiconParameter($true, true); } else { $objectInterface = Parameter::parseLexiconParameter($false, true); } return $objectInterface; }
/** * mappableFilter * @param LexiconMethod[] $subParsed * @return array */ public function mappableFilter(array $subParsed) { $outputValue = []; foreach ($this->getModel()->getValue() as $key => $value) { $output = Parameter::parseLexiconParameter($subParsed, false, Root::createObject($value)); if ($output instanceof BooleanInterface) { /** @var BooleanInterface $output */ $output = $output->getValue(); } if ($output) { $outputValue[] = $value; } } return $outputValue; }