You are here

public function EckEntity::setOwnerId in Entity Construction Kit (ECK) 8

Sets the entity owner's user ID.

Parameters

int $uid: The owner user id.

Return value

$this

Overrides EntityOwnerInterface::setOwnerId

1 call to EckEntity::setOwnerId()
EckEntity::setOwner in src/Entity/EckEntity.php
Sets the entity owner's user entity.

File

src/Entity/EckEntity.php, line 78

Class

EckEntity
Defines the ECK entity.

Namespace

Drupal\eck\Entity

Code

public function setOwnerId($uid) {
  if ($this
    ->hasField('uid')) {
    $this
      ->set('uid', $uid);
  }
  return $this;
}