public function execute($actionParams) { $action = $this->expression; list($beanClass, $methodName) = BeanUtil::getBeanAndProperties($action); $beanInstance = BeanLocator::get($beanClass); return ReflectionUtil::callMethod($beanInstance, $methodName, $actionParams); }
private function updateModel(MovicoRequest $req) { $vars = $req->getPostVars(); foreach ($vars as $var) { list($beanClass, $nestedProperty) = BeanUtil::getBeanAndProperties($var->getName(), true); ReflectionUtil::callNestedSetter(BeanLocator::get($beanClass), $nestedProperty, $var->getConvertedValue()); } $files = $req->getFiles(); foreach ($files as $key => $fileArray) { $file = new UploadedFile($fileArray); list($beanClass, $nestedProperty) = BeanUtil::getBeanAndProperties($key, true); ReflectionUtil::callNestedSetter(BeanLocator::get($beanClass), $nestedProperty, $file); } }
private function getBeanValue($valueExpression, $rowIndex = null) { list($beanClass, $nestedProperty) = BeanUtil::getBeanAndProperties($valueExpression); try { $beanObj = BeanLocator::get($beanClass); } catch (NoSuchBeanException $e) { try { $dataSeries = $this->getFirstAncestorOfType("DataSeries"); if ($dataSeries->getVar() !== $beanClass || is_null($rowIndex)) { throw new NoSuchBeanException($beanClass); } $rows = $dataSeries->getRows(); $beanObj = $rows[$rowIndex]; } catch (NoSuchAnchestorComponentException $e) { throw new NoSuchBeanException($beanClass); } } return ReflectionUtil::callNestedGetter($beanObj, $nestedProperty); }
public function getRows() { list($beanClass, $nestedProperty) = BeanUtil::getBeanAndProperties($this->value); $beanObj = BeanLocator::get($beanClass); return ReflectionUtil::callNestedGetter($beanObj, $nestedProperty); }