class BlogLister in Blog 3.x
Same name and namespace in other branches
- 8.2 src/BlogLister.php \Drupal\blog\BlogLister
Defines a blog lister.
Hierarchy
- class \Drupal\blog\BlogLister implements BlogListerInterface
Expanded class hierarchy of BlogLister
1 string reference to 'BlogLister'
1 service uses BlogLister
File
- src/
BlogLister.php, line 13
Namespace
Drupal\blogView source
class BlogLister implements BlogListerInterface {
/**
* Config Factory Service Object.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* The current user account.
*
* @var \Drupal\Core\Session\AccountInterface
*/
protected $account;
/**
* Constructs a BlogLister object.
*/
public function __construct(AccountInterface $account, ConfigFactoryInterface $config_factory) {
$this->account = $account;
$this->configFactory = $config_factory;
}
/**
* {@inheritdoc}
*
* @param \Drupal\user\UserInterface $user
* User object.
*
* @return string
* Title string
*/
public function userBlogTitle(UserInterface $user) {
return new TranslatableMarkup("@username's blog", [
'@username' => $user
->getDisplayName(),
]);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
BlogLister:: |
protected | property | The current user account. | |
BlogLister:: |
protected | property | Config Factory Service Object. | |
BlogLister:: |
public | function |
Overrides BlogListerInterface:: |
|
BlogLister:: |
public | function | Constructs a BlogLister object. |