Example #1
0
 /**
  */
 public function __construct($type = "BlogPosting")
 {
     parent::__construct($type);
 }
Example #2
0
 /**
  * createArticleEntity
  *
  * @return Article
  */
 public function createArticleEntity()
 {
     $article = new Article();
     // Basic info
     $article->headline = get_the_title();
     $article->datePublished = get_the_date('Y-m-d H:i:s');
     $article->url = get_permalink();
     $article->setId(get_permalink());
     // Addition info
     $article->articleSection = get_the_category()[0]->cat_name;
     $article->dateModified = get_the_modified_date('Y-m-d H:i:s');
     $article->commentCount = get_comments_number();
     // Thumbnail if exists
     return $article;
 }