class EntityServicePreferenceEvent in Avatar Kit 8.2
Used to determine the preference order of avatar services for an entity.
Hierarchy
- class \Drupal\avatars\Event\EntityServicePreferenceEvent extends \Symfony\Component\EventDispatcher\Event
Expanded class hierarchy of EntityServicePreferenceEvent
See also
\Drupal\avatars\Event\AvatarKitEvents::ENTITY_SERVICE_PREFERENCE
3 files declare their use of EntityServicePreferenceEvent
File
- src/
Event/ EntityServicePreferenceEvent.php, line 13
Namespace
Drupal\avatars\EventView source
class EntityServicePreferenceEvent extends Event {
/**
* An array of weights keyed by avatar service entity ID's.
*
* Lower value weights are higher priority.
*
* @var int[]
*/
protected $services;
/**
* The entity to get preferences.
*
* @var \Drupal\Core\Entity\EntityInterface
*/
protected $entity;
/**
* Get weights for avatar services.
*
* @return string[]
* An array of weights keyed by avatar service entity ID's.
*/
public function getServices() : array {
return $this->services;
}
/**
* Sets weights for avatar services.
*
* @param string[] $services
* An array of weights keyed by avatar service entity ID's.
*
* @return $this
* Returns this event for chaining.
*/
public function setServices(array $services) : self {
$this->services = $services;
return $this;
}
/**
* Get the entity preferences are being set for.
*
* @return \Drupal\Core\Entity\EntityInterface
* The entity preferences are being set for.
*/
public function getEntity() : EntityInterface {
return $this->entity;
}
/**
* Set the entity preferences are being set for.
*
* @param \Drupal\Core\Entity\EntityInterface $entity
* The entity preferences are being set for.
*
* @return $this
* Returns this event for chaining.
*/
public function setEntity(EntityInterface $entity) : self {
$this->entity = $entity;
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
EntityServicePreferenceEvent:: |
protected | property | The entity to get preferences. | |
EntityServicePreferenceEvent:: |
protected | property | An array of weights keyed by avatar service entity ID's. | |
EntityServicePreferenceEvent:: |
public | function | Get the entity preferences are being set for. | |
EntityServicePreferenceEvent:: |
public | function | Get weights for avatar services. | |
EntityServicePreferenceEvent:: |
public | function | Set the entity preferences are being set for. | |
EntityServicePreferenceEvent:: |
public | function | Sets weights for avatar services. |