function &_getArticleData($section_id, $max_qty)
 {
     $empty_value = false;
     if (!$this->_source->makeReady()) {
         return $empty_value;
     }
     $result = array();
     $related_set = AMPContentLookup_RelatedArticles::instance($section_id);
     $related_ids = $related_set ? array_keys($related_set) : array();
     while ($data = $this->_source->getData()) {
         if (isset($max_qty) && count($result) == $max_qty) {
             break;
         }
         if ($data['type'] != $section_id && array_search($data['id'], $related_ids) === FALSE) {
             continue;
         }
         $result[$data['id']] = $data;
     }
     if (empty($result)) {
         return $empty_value;
     }
     return $result;
 }
Exemplo n.º 2
0
 function makeCriteriaRelatedSection($section_id)
 {
     $related_articles =& AMPContentLookup_RelatedArticles::instance($section_id);
     if (!$related_articles) {
         return false;
     }
     return 'id in ( ' . join(',', $related_articles) . ')';
 }
Exemplo n.º 3
0
 function getRelatedArticles($section_id)
 {
     require_once 'AMP/Content/Section/RelatedSet.inc.php';
     if (!isset($section_id)) {
         return false;
     }
     $relatedContent = AMPContentLookup_RelatedArticles::instance($section_id);
     if (empty($relatedContent)) {
         return false;
     }
     return "id in (" . join(", ", array_keys($relatedContent)) . ")";
 }