CMS  Version 3.9
ArticleCommentXref Class Reference

Inherits DataItem.

Public Member Functions

 verifyEnabled ($article_id)
 
 getURL ()
 
 Article ()
 
 Comment ()
 
 ArticleCommentXref ()
 

Public Attributes

 $fields
 
 $relations
 

Detailed Description

Definition at line 335 of file article.inc.

Member Function Documentation

◆ Article()

ArticleCommentXref::Article ( )

Definition at line 371 of file article.inc.

372  {
373  return $this->getRelated(Article);
374  }
Defines the Article class.
Definition: article.inc:45

◆ ArticleCommentXref()

ArticleCommentXref::ArticleCommentXref ( )

Definition at line 381 of file article.inc.

382  {
383  $this->table = "article_comment_xref";
384  $this->primary_key = "article_comment_xref_id";
385  $this->DataItem(func_get_args());
386  }

◆ Comment()

ArticleCommentXref::Comment ( )

Definition at line 376 of file article.inc.

377  {
378  return $this->getRelated(Comment);
379  }

◆ getURL()

ArticleCommentXref::getURL ( )

Definition at line 362 of file article.inc.

363  {
364  if(!$this->article_id) return "";
365 
366  $url = $this->Article()->getUrl();
367 
368  return $url . $this->format("#comment{comment_id}");
369  }
Article()
Definition: article.inc:371
if(! $blog->published||! $blog->enable_rss_feed||!checkRole($blog->allow_read)) $url
Definition: rss.inc:58

◆ verifyEnabled()

ArticleCommentXref::verifyEnabled (   $article_id)

Definition at line 344 of file article.inc.

345  {
346  if (!$article_id) return false;
347 
348  try
349  {
350  $article = $this->Article();
351  // returns null if no related blog
352  $blog = $article->getBlog();
353 
354  return ($blog) ? $blog->allow_comments : $article->allow_comment;
355  }
356  catch(DataNotFoundException $e)
357  {
358  return false;
359  }
360  }
$blog
if(! $article_id) $article
Definition: article.inc:44
$article_id
Definition: article.inc:37

Member Data Documentation

◆ $fields

ArticleCommentXref::$fields
Initial value:
= array("article_comment_xref_id" => Number,
"article_id" => Number,
"comment_id" => Number)

Definition at line 337 of file article.inc.

◆ $relations

ArticleCommentXref::$relations
Initial value:
= array( "Article" => Article,
"Comment" => Comment)

Definition at line 341 of file article.inc.


The documentation for this class was generated from the following file: