You are here

public function Post::getOwnerId in Open Social 10.3.x

Same name and namespace in other branches
  1. 8.9 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  2. 8 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  3. 8.2 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  4. 8.3 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  5. 8.4 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  6. 8.5 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  7. 8.6 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  8. 8.7 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  9. 8.8 modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  10. 10.0.x modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  11. 10.1.x modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()
  12. 10.2.x modules/social_features/social_post/src/Entity/Post.php \Drupal\social_post\Entity\Post::getOwnerId()

Returns the entity owner's user ID.

Return value

int|null The owner user ID, or NULL in case the user ID field has not been set on the entity.

Overrides EntityOwnerInterface::getOwnerId

File

modules/social_features/social_post/src/Entity/Post.php, line 103

Class

Post
Defines the Post entity.

Namespace

Drupal\social_post\Entity

Code

public function getOwnerId() {
  return $this
    ->get('user_id')->target_id;
}