/** * Sets new map items by array * * @param array $map Array with initial data: * Any element is a hash: * holder > string * requered > bool * glue > string * * @return RM_ReportScript_Map */ public function setMapByArray(array $map) { foreach ($map as $item) { $this->addMapItem($this->_mapper->createMapItem($item)); } return $this; }
/** * Adds command to queue. * * @param RM_ReportScript_Queue $queue * @return RM_ReportScript_Queue */ public function addToQueue(RM_ReportScript_Queue $queue = NULL) { if (isNull($queue)) { $queue = $this->_mapper->createQueue(); } $this->_mapper->addCommandToQueue($queue, $this); return $queue; }
public function _checkStatus() { $this->_status = $this->_mapper->getStatusForQueue($this); if ($this->_status != $this->status_id) { $this->status_id = $this->_status; $this->save(); } }
/** * @see RM_Store_Object::delete */ public function delete() { if (count($this->_mapper->getCompositeListForScript($this)) > 0) { throw new RM_Validator_Exception(M('Base')->error('has_depended_composite')); } parent::delete(); if (!isNull($this->_map)) { $this->_mapper->deleteMap($this); } return TRUE; }
protected function _trace($script, $time = NULL) { if ($this->_mapper->trace()) { if ($time) { $message = sprintf("Execution time: %s\n%s", $time, $script); } else { $message = sprintf("Script failed: %s", $script); } M('Trace')->trace("ReportScript[mysql]", $message); } }
/** * Returns queue for queued command * * @return RM_ReportScript_Queue */ public function getQueue() { return $this->_mapper->loadQueueById($this->queue_id); }
/** * Returns null script * * @return RM_ReportScrip_Null_Script */ public function getNullScript($executer = 'mysql', $composite = FALSE) { return $this->_mapper->getNullObject('script', array('script_type' => $composite ? 'c' : 's', 'executer' => $executer)); }