Exemplo n.º 1
0
 function _getRelatedArticles($section_id = null)
 {
     //deprecated, use SectionContentsManager:: or AMP_Content_Article:: methods instead
     require_once 'AMP/Content/Section/RelatedSet.inc.php';
     if (!isset($section_id)) {
         $section_id = $this->_section->id;
     }
     $related = new SectionRelatedSet($this->_section->dbcon, $section_id);
     $relatedContent = $related->getLookup('typeid');
     if (empty($relatedContent)) {
         return false;
     }
     return "id in (" . join(", ", array_keys($relatedContent)) . ")";
 }
Exemplo n.º 2
0
 function drop_all_relations($article_id)
 {
     require_once 'AMP/Content/RouteSlug/RouteSlug.php';
     $rs = new AMP_Content_RouteSlug($this->dbcon);
     $routes = $rs->getSearchSource();
     $routes->deleteData(implode(' AND ', $rs->makeCriteria(array('owner_type' => 'article', 'owner_id' => $this->id))));
     require_once 'AMP/Content/Section/RelatedSet.inc.php';
     $related_section_set = new SectionRelatedSet(AMP_Registry::getDbcon());
     return $related_section_set->deleteData('articleid=' . $article_id);
 }