<?php // \Drupal\Core\Entity\EntityInterface interface EntityInterface { public function id(); // ... } // \Drupal\user\UserInterface interface UserInterface extends EntityInterface { // ... } // \Drupal\user\User class User implements UserInterface { public function id() {} } // \Drupal\Core\Entity\OwnedEntityInterface interface OwnedEntityInterface { public function setOwnerId($id); public function getOwnerId(); } // \Drupal\user\EntityOwnerInterface interface EntityOwnerInterface extends OwnedEntityInterface { public function setOwner(UserInterface $owner); public function getOwner(); } // Example class. class OwnedEntity implements EntityOwnerInterface { public function setOwnerId($id) {} public function getOwnerId() {} public function setOwner(UserInterface $owner) {} public function getOwner() {} } $user = new User(); $entity = new OwnedEntity(); $entity->setOwnerId($user->id());
You have javascript disabled. You will not be able to edit any code.