*/ class BlogCommentExtension extends DataExtension { /** * Extra CSS classes for styling different comment types. * * @return string */ public function getExtraClass() { $blogPost = $this->owner->Parent(); if ($blogPost instanceof BlogPost) { if ($blogPost->isAuthor($this->owner->Author())) { return 'author-comment'; } } return ''; } }