Example #1
0
 public function reflectApplyFunction($sName, array $aPath, $sMode, $bRead = false, $sArguments = '', array $aArguments = array())
 {
     switch ($sName) {
         //case 'apply' : $result = $this->reflectApply(''); break;
         case 'name':
             $result = $this->getName();
             break;
         case 'title':
             $result = $this->getTitle();
             break;
         case 'position':
             $result = $this->getPosition();
             break;
         case 'length':
             $result = $this->getLength();
             break;
         case 'collection':
             $result = $this->getHandler()->parsePathToken($this->getCollection(), $aPath, $sMode, $bRead, $aArguments);
             break;
         case 'parent':
             $result = $this->getHandler()->parsePathToken($this->getParent(), $aPath, $sMode, $bRead, $aArguments);
             break;
         case 'column':
             $result = $this->reflectColumn(array_pop($aPath));
             break;
         default:
             $result = parent::reflectApplyFunction($sName, $aPath, $sMode, $bRead, $sArguments, $aArguments);
     }
     return $result;
 }
Example #2
0
 public function reflectApplyFunction($sName, array $aPath, $sMode, $bRead = false, $sArguments = '', array $aArguments = array())
 {
     switch ($sName) {
         case 'init':
             $result = $this->buildStart();
             break;
         case 'static':
             $result = $aPath ? $this->getHandler()->parsePathToken($this->getTable(), $aPath, $sMode, true, $aArguments) : $this->getTable()->reflectApply($sMode, $aArguments, true);
             break;
         case 'counter':
             $result = $this->getCounter();
             break;
         case 'count':
             $result = $this->getCount();
             break;
         case 'count-distinct':
             $result = $this->getCounter()->setDistinct($this->getWindow()->parse($aArguments));
             break;
         case 'pager':
             $result = $this->getPager()->reflectApply($sMode);
             break;
         case 'distinct':
             $aFunctionArguments = $this->getHandler()->getPather()->parseArguments($sArguments, $sMode, $bRead, false);
             $result = $this->getDistinct($aFunctionArguments, $aPath, $sMode, $aArguments);
             break;
         case 'has-children':
             $this->preBuild();
             $result = array();
             if ($this->insertQuery()) {
                 $result[] = $this->getQuery();
             }
             $this->insertQuery(false);
             $result[] = $this->getQuery()->getVar()->call('hasChildren');
             break;
         default:
             $result = parent::reflectApplyFunction($sName, $aPath, $sMode, $bRead, $sArguments, $aArguments);
     }
     return $result;
 }