silverstripe-blog/code/extensions/BlogCommentExtension.php
2015-11-21 19:17:29 +13:00

26 lines
508 B
PHP

<?php
/**
* Adds Blog specific behaviour to Comment.
*/
class BlogCommentExtension extends DataExtension
{
/**
* Extra CSS classes for styling different comment types.
*
* @return string
*/
public function getExtraClass()
{
$blogPost = $this->owner->getParent();
if ($blogPost instanceof BlogPost) {
if ($blogPost->isAuthor($this->owner->Author())) {
return 'author-comment';
}
}
return '';
}
}