public static function Comment::getDefaultHostname in Drupal 8
Same name and namespace in other branches
- 9 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::getDefaultHostname()
Returns the default value for entity hostname base field.
Return value
string The client host name.
File
- core/
modules/ comment/ src/ Entity/ Comment.php, line 560
Class
- Comment
- Defines the comment entity class.
Namespace
Drupal\comment\EntityCode
public static function getDefaultHostname() {
if (\Drupal::config('comment.settings')
->get('log_ip_addresses')) {
return \Drupal::request()
->getClientIP();
}
return '';
}