You are here

public function SocialApi::getUserId in Social API 8.2

Same name and namespace in other branches
  1. 3.x src/Entity/SocialApi.php \Drupal\social_api\Entity\SocialApi::getUserId()

Gets the Drupal user ID associated to the record.

Return value

int User ID.

File

src/Entity/SocialApi.php, line 45

Class

SocialApi
Defines a base class for Social API content entities.

Namespace

Drupal\social_api\Entity

Code

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