Esempio n. 1
0
 protected function loadTriggers()
 {
     $aResult = parent::loadTriggers();
     if (!$this->isSub()) {
         $aResult[] = $this->getWindow()->toString('1', $this->getParser()->getView()->getResult());
     }
     return $aResult;
 }
Esempio n. 2
0
 /**
  * @todo (wip) single reference insert, need main and sub form invert
  */
 public function _loadSingleReference($sName, self $table, array $aPath, $sMode, array $aArguments = array(), sql\schema\element $foreign = null, $val = null)
 {
     $window = $this->getWindow();
     $arg = $window->tokenToInstance(self::$sArgumentClass);
     $from = $window->callFunction('current', 'php-boolean', array($table->getElementArgument($sName, 'query')));
     $source = $window->createVar($window->createInstanciate($arg, array($from)));
     $table->setSource($source);
     $key = $window->addVar($window->argToInstance(0));
     $this->init();
     $table->init($key, $source);
     $aContent[] = $window->toString($this->getParser()->parsePathToken($table, $aPath, $sMode, false, $aArguments));
     $aContent[] = $this->getValidation();
     if ($foreign) {
         $table->addElement($foreign, $val);
     }
     $table->addContent($source->getInsert());
     $table->addContent($aContent);
     $table->addValidate($this->callValidate());
     $table->addTrigger(array($this->getExecution()));
     $this->addContent($table);
     //return $table;
 }