Example #1
0
 public function loadSingleReference($sName, sql\template\insert\Table $table, array $aPath, $sMode, array $aArguments = array(), sql\schema\element $foreign = null, $val = null)
 {
     $window = $this->getWindow();
     //$table->isSub(true);
     //$arg = $window->tokenToInstance(self::$sArgumentClass);
     //$from = $window->callFunction('current', '\sylma\core\argument', array($this->getElementArgument($sName, 'get')));
     //$source = $window->createVar($window->createInstanciate($arg, array($from)));
     $source = $window->createVar($this->getElementArgument($sName, 'get'));
     //$source = $window->createVar($this->getElementArgument($sName, 'get'));
     $aContent[] = $source->getInsert();
     $table->setSource($source);
     $key = $window->addVar($window->argToInstance(0));
     $table->init($key, $this->getDummy());
     $aContent[] = $window->toString($this->getParser()->parsePathToken($table, $aPath, $sMode, false, $aArguments));
     $aContent[] = $table->getValidation();
     if ($foreign) {
         $this->addElement($foreign, $val);
     }
     $this->addContent($aContent);
     $this->addValidate($table->callValidate());
     $this->addTrigger(array($table->getExecution()));
 }