Esempio n. 1
0
 protected function createInstanciation(common\_window $window, array $aArguments)
 {
     switch ($this->getReturn()) {
         case 'result':
             $sReturn = current($aArguments);
             break;
         case 'array':
             $sReturn = $window->argToInstance($aArguments);
             break;
         case '':
         case 'default':
             $sReturn = $window->createInstanciate($window->getSelf()->getInstance(), $aArguments);
             break;
         default:
             $this->launchException("Unknown @return value : " . $this->getReturn());
     }
     $window->setReturn($sReturn);
 }
Esempio n. 2
0
 public function addInstance(common\_window $window, dom\collection $children)
 {
     $aArguments = $this->parseArguments($children);
     if ($file = $this->getFile()) {
         $require = $window->callFunction('require_once', $window->argToInstance('php-bool'), array($file->getRealPath()));
         $window->add($require);
     }
     $instance = $window->loadInstance($this->getName(), $file);
     return $window->createInstanciate($instance, $aArguments);
 }