protected function setVar(common\_var $var) { if (!$var->getInstance() instanceof instance\_Array) { $this->getWindow()->throwException('Can call key only on array'); } $this->var = $var; }
public function __construct(common\_window $controler, $looped, common\_var $var, $content = null, $key = null) { $this->setControler($controler); $this->looped = $looped; $this->var = $var; $this->key = $key; $var->insert(null, false); if ($content) { $this->addContent($content); } }
protected function buildVariable(common\_var $var) { $isset = $this->callFunction('isset', $this->tokenToInstance('php-boolean'), array($var)); $new = $this->createInstanciate($var->getInstance()); $this->add($this->createCondition($this->createNot($isset), $this->createAssign($var, $new))); }
protected function checkContext(common\_var $contexts, $sPath, $sAlias, $window) { $aResult = array(); $context = $contexts->call('get', array($sPath, false), '\\sylma\\core\\window\\context')->getVar(false); $aResult[] = $context->getInsert(); $if = $window->createCondition($window->createNot($context)); $new = $this->createObject($sAlias, array(), $window, false); $call = $contexts->call('set', array($sPath, $new, true)); $if->addContent($context->getInsert($call)); $aResult[] = $if; return array($aResult, $context); }
public function setVariable(common\_var $var, $bDebug = true) { $sName = $var->getName(); if ($bDebug && array_key_exists($sName, $this->aVariables)) { $this->throwException(sprintf('Variable %s ever registered', $sName)); } $this->aVariables[$sName] = $var; }