public function Post::getVisibility in Open Social 8.7
Same name and namespace in other branches
- 8.9 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 8.4 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 8.5 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 8.6 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 8.8 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 10.3.x modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 10.0.x modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 10.1.x modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
- 10.2.x modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getVisibility()
File
- modules/
social_features/ social_post/ src/ Entity/ Post.php, line 163
Class
- Post
- Defines the Post entity.
Namespace
Drupal\social_post\EntityCode
public function getVisibility() {
if ($this
->hasField('field_visibility')) {
switch ($this->field_visibility->value) {
case "0":
case "2":
$visibility = 'community';
break;
case "1":
$visibility = 'public';
break;
case "3":
$visibility = 'group';
break;
}
}
return $visibility;
}