/** * Constructor * * @param mixed $po_db instance of the db driver you are using * @param mixed $pr_res SQL result set resource */ function __construct(&$po_db, $pr_res) { $this->opo_datamodel = Datamodel::load(); if (!isset($GLOBALS["_DbResult_time_expression_parser"]) || !$GLOBALS["_DbResult_time_expression_parser"]) { $GLOBALS["_DbResult_time_expression_parser"] = new TimeExpressionParser(); } if (!isset($GLOBALS["_DbResult_timecodeparser"]) || !$GLOBALS["_DbResult_timecodeparser"]) { $GLOBALS["_DbResult_timecodeparser"] = new TimecodeParser(); } if (!isset($GLOBALS["_DbResult_mediainfocoder"]) || !$GLOBALS["_DbResult_mediainfocoder"]) { $GLOBALS["_DbResult_mediainfocoder"] = MediaInfoCoder::load(); } if (!isset($GLOBALS["_DbResult_fileinfocoder"]) || !$GLOBALS["_DbResult_fileinfocoder"]) { $GLOBALS["_DbResult_fileinfocoder"] = FileInfoCoder::load(); } $this->opo_db =& $po_db; $this->opr_res = $pr_res; $this->opn_current_row = 0; }
public function __construct($po_engine_result = null, $pa_tables = null) { $this->opo_db = new Db(); $this->opo_datamodel = Datamodel::load(); $this->opo_subject_instance = $this->opo_datamodel->getInstanceByTableName($this->ops_table_name, true); $this->opo_locales = new ca_locales(); $this->ops_subject_pk = $this->opo_subject_instance->primaryKey(); $this->ops_subject_idno = $this->opo_subject_instance->getProperty('ID_NUMBERING_ID_FIELD'); $this->opb_use_identifiers_in_urls = (bool) $this->opo_subject_instance->getAppConfig()->get('use_identifiers_in_urls'); $this->opa_row_ids_to_prefetch_cache = array(); if ($po_engine_result) { $this->init($po_engine_result, $pa_tables); } if (!$GLOBALS["_DbResult_time_expression_parser"]) { $GLOBALS["_DbResult_time_expression_parser"] = new TimeExpressionParser(); } if (!$GLOBALS["_DbResult_timecodeparser"]) { $GLOBALS["_DbResult_timecodeparser"] = new TimecodeParser(); } if (!$GLOBALS["_DbResult_mediainfocoder"]) { $GLOBALS["_DbResult_mediainfocoder"] = MediaInfoCoder::load(); } if (!$GLOBALS["_DbResult_fileinfocoder"]) { $GLOBALS["_DbResult_fileinfocoder"] = FileInfoCoder::load(); } $this->opt_list = $this->opo_datamodel->getInstanceByTableName('ca_lists', true); // valid options and defaults $this->opa_options = array('prefetch' => 50); $this->opo_tep = $GLOBALS["_DbResult_time_expression_parser"]; }