class EntityInsertEvent in Entity Share 8.2
Defines an event for altering the entity.
Hierarchy
- class \Drupal\entity_share_client\Event\EntityInsertEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of EntityInsertEvent
1 file declares its use of EntityInsertEvent
- JsonapiHelper.php in modules/
entity_share_client/ src/ Service/ JsonapiHelper.php
File
- modules/
entity_share_client/ src/ Event/ EntityInsertEvent.php, line 14
Namespace
Drupal\entity_share_client\EventView source
class EntityInsertEvent extends Event {
const EVENT_NAME = 'entity_share_client.entity_insert';
/**
* The Entity object.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
protected $entity;
/**
* The remote entity.
*
* @var \Drupal\entity_share_client\Entity\RemoteInterface
*/
protected $remote;
/**
* EntityAlterEvent constructor.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity being manipulated.
* @param \Drupal\entity_share_client\Entity\RemoteInterface $remote
* The remote entity.
*/
public function __construct(EntityInterface $entity, RemoteInterface $remote) {
$this->entity = $entity;
$this->remote = $remote;
}
/**
* Returns the entity object.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity being manipulated.
*/
public function getEntity() {
return $this->entity;
}
/**
* The remote entity.
*
* @return \Drupal\entity_share_client\Entity\RemoteInterface
* The remote.
*/
public function getRemote() {
return $this->remote;
}
/**
* Sets the Entity object.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity being manipulated.
*/
public function setEntity(EntityInterface $entity) {
$this->entity = $entity;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityInsertEvent:: |
protected | property | The Entity object. | |
EntityInsertEvent:: |
protected | property | The remote entity. | |
EntityInsertEvent:: |
constant | |||
EntityInsertEvent:: |
public | function | Returns the entity object. | |
EntityInsertEvent:: |
public | function | The remote entity. | |
EntityInsertEvent:: |
public | function | Sets the Entity object. | |
EntityInsertEvent:: |
public | function | EntityAlterEvent constructor. |