Example #1
0
 private function taxonomy_content_query($controller, $params)
 {
     if (isset($params['id'])) {
         $tables = DB_CONTENT . ', ' . DB_CONTENT_LOOKUP;
         $columns = DB_CONTENT . '.*';
         $where = "content.contentid=content_lookup.content_id and content_lookup.taxa_id=?";
         $field = array($params['id']);
         $db_results = BuildQuery::all_field_query($tables, $columns, $where, $field);
         self::$db_taxonomy_content = $db_results;
     }
 }
Example #2
0
 private function taxonomy_row_query($params)
 {
     if (isset($params['id'])) {
         $table = DB_TAXONOMY;
         $where = "taxa_id";
         $field = array($params['id']);
         //build single query from BuildQuery class
         $db_results = BuildQuery::single_row_query($table, $where, $field);
         self::$db_taxonomy_row = $db_results;
     }
 }
Example #3
0
 private function taxonomy_content_check($controller, $params)
 {
     $child_content = array();
     if (isset($params['id'])) {
         $db_results = $this->taxonomy_content_query($controller, $params);
         //check content for passed taxa id
         if (empty($db_results)) {
             //check for children if no content available
             $child_db_results = $this->taxonomy_child_query($params);
             foreach ($child_db_results as $key => $val) {
                 //check values from query
                 if (is_array($val)) {
                     //get taxa id for each child
                     $child_id = $val['taxa_id'];
                     $params_child['id'] = $child_id;
                     //check content for each returned child
                     $db_child_results = $this->taxonomy_content_query($controller, $params_child);
                     foreach ($db_child_results as $key2 => $val2) {
                         //push child content
                         array_push($child_content, $val2);
                     }
                 }
             }
             self::$db_taxonomy_content = $child_content;
         } else {
             self::$db_taxonomy_content = $db_results;
         }
     }
 }