Beispiel #1
0
 public function __construct($po_engine_result = null, $pa_tables = null)
 {
     if (!SearchResult::$opo_datamodel) {
         SearchResult::$opo_datamodel = Datamodel::load();
     }
     $this->opo_db = SearchResult::$o_db ? SearchResult::$o_db : (SearchResult::$o_db = new Db());
     $this->opo_subject_instance = SearchResult::$opo_datamodel->getInstanceByTableName($this->ops_table_name, true);
     $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 (!SearchResult::$opo_locales) {
         SearchResult::$opo_locales = new ca_locales();
     }
     if (!SearchResult::$opa_locales) {
         SearchResult::$opa_locales = ca_locales::getLocaleList();
     }
     if (!SearchResult::$opt_list) {
         SearchResult::$opt_list = SearchResult::$opo_datamodel->getInstanceByTableName('ca_lists', true);
     }
     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();
     }
     // valid options and defaults
     $this->opa_options = array('prefetch' => 50, 'prefetchAttributes' => null);
     $this->opo_tep = $GLOBALS["_DbResult_time_expression_parser"];
     if (!is_array(self::$s_template_prefetch_cache)) {
         self::$s_template_prefetch_cache = array();
     }
 }