Esempio n. 1
0
 /**
  * Removes a script from composite
  *
  * @param RM_ReportScript_iScript 		$script
  * @return 	bool
  */
 public function removeScript(RM_ReportScript_iScript $script)
 {
     foreach ($this->getScriptList() as $id => $item) {
         if ($item->id() == $script->id()) {
             unset($this->_stack[$id]);
             return TRUE;
         }
     }
     throw new RM_Base_Exception_BadUsage("Trying to remove an unexisting in composition script #" . $script->id() . " (`" . ($script->name ? 'unnamed' : $script->name) . "')");
 }
Esempio n. 2
0
 /**
  * Prepares script to be executed or queued
  *
  * @return unknown
  */
 public function prepare()
 {
     if ($this->_body) {
         return $this;
     }
     $this->_body = $this->_script->body;
     if (isNull($map = $this->_script->getMap())) {
         return $this;
     }
     $holders = $this->_collectDataFromMines();
     foreach ($map->getItemList() as $item) {
         $this->_body = $item->replaceHolders($this->_body, $holders);
     }
     return $this;
 }
Esempio n. 3
0
 public function deleteMap(RM_ReportScript_iScript $script)
 {
     $q = M('Db')->createQuery($this->_table['map'], 'delete')->where('script_id=?', $script->id());
     $q->execute();
 }