/** * @param AbstractObject $context * * @return mixed */ public function overloadSetRecord(callable $next, AbstractObject $context) { $this->record = $context->getArg(0); $element = $context->getElement(); if ($element->getTag() == 'form') { $element->setID(lcfirst('form' . str_replace(['\\', 'Record'], '', get_class($this->record)))); $element->setName($element->getID()); } return $next(); }
/** * @param AbstractObject $context * * @return mixed */ public function overloadAddStep(callable $next, AbstractObject $context) { $form = $context->getElement(); $step = $form->addFieldset($context->getArg(0)); //$step->addDecorator($form->decoratorFactory->create('Step')); //$step->addHandler($form->handlerFactory->create('Step')); $step->setStep(); $step->setForm($form); return $step; }
/** * @param AbstractObject $context * * @return mixed */ public function overloadSetHeading(callable $next, AbstractObject $context) { $this->heading = $context->getArg(0); return $next(); }
public function overloadSetUploadable(callable $next, AbstractObject $context) { $this->uploadable = $context->getArg(0); return $next(); }
/** * @param AbstractObject $context * * @return mixed */ public function setRecord(callable $next, AbstractObject $context) { $this->record = $context->getArg(0); return $next(); }
public function overloadUseStrategy(callable $next, AbstractObject $context) { $this->strategy = is_object($context->getArg(0)) ? $context->getArg(0) : $context->getElement()->decoratorFactory->create($context->getArg(0)); return $next(); }
/** * @param AbstractObject $context * * @return mixed */ public function overloadSetGrouped(callable $next, AbstractObject $context) { $this->grouped = $context->getArg(0); return $next(); }
/** * @param AbstractObject $context * * @return array */ public function overloadRemoveChildren(callable $next, AbstractObject $context) { $regex = $context->getArg(0); $element = $context->getElement(); $arrChildren = []; foreach ($element->getChildren() as $i => $child) { if ($child instanceof Element && $child->matchesRegex($regex)) { $arrChildren[] = $child; $element->unsetChild($i); } } return $arrChildren; }
/** * @param AbstractObject $context * * @return mixed */ public function overloadMin(callable $next, AbstractObject $context) { $this->min = $context->getArg(0); return $next(); }
/** * @param AbstractObject $context * * @return mixed */ public function overloadMax(callable $next, AbstractObject $context) { $this->max = $context->getArg(0); $context->getElement()->setAttribute('max', $this->max); return $next(); }