class ApiProduct in Apigee Edge 8
Defines the API product entity class.
@\Drupal\apigee_edge\Annotation\EdgeEntityType( id = "api_product", label =
Plugin annotation
@Translation("API"),
label_collection = @Translation("APIs"),
label_singular = @Translation("API"),
label_plural = @Translation("APIs"),
label_count = @PluralTranslation(
singular = "@count API",
plural = "@count APIs",
),
config_with_labels = "apigee_edge.api_product_settings",
handlers = {
"storage" = "\Drupal\apigee_edge\Entity\Storage\ApiProductStorage",
"access" = "Drupal\Core\Entity\EntityAccessControlHandler",
},
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait
- class \Drupal\apigee_edge\Entity\EdgeEntityBase implements EdgeEntityInterface
- class \Drupal\apigee_edge\Entity\ApiProduct implements ApiProductInterface uses RevisioningWorkaroundTrait
- class \Drupal\apigee_edge\Entity\EdgeEntityBase implements EdgeEntityInterface
Expanded class hierarchy of ApiProduct
12 files declare their use of ApiProduct
- ApigeeEdgeFunctionalTestTrait.php in tests/
src/ Traits/ ApigeeEdgeFunctionalTestTrait.php - apigee_edge.module in ./
apigee_edge.module - Copyright 2018 Google Inc.
- ApiProductAccessTest.php in tests/
src/ FunctionalJavascript/ ApiProductAccessTest.php - ApiProductTest.php in tests/
src/ Unit/ Entity/ ApiProductTest.php - AppListBuilderTest.php in tests/
src/ Kernel/ Entity/ ListBuilder/ AppListBuilderTest.php
File
- src/
Entity/ ApiProduct.php, line 46
Namespace
Drupal\apigee_edge\EntityView source
class ApiProduct extends EdgeEntityBase implements ApiProductInterface {
// The majority of Drupal core & contrib assumes that an entity to be
// displayed is a content entity, and because it is a content entity it also
// must support revisioning.
// Having this trait addresses the following issue in the EntityViewBuilder.
// https://www.drupal.org/node/2951487
use RevisioningWorkaroundTrait;
/**
* ApiProduct constructor.
*
* @param array $values
* An array of values to set, keyed by property name.
* @param null|string $entity_type
* Type of the entity. It is optional because constructor sets its default
* value.
* @param \Apigee\Edge\Entity\EntityInterface|null $decorated
* The SDK entity that this Drupal entity decorates.
*/
public function __construct(array $values, ?string $entity_type = NULL, ?EdgeEntityInterface $decorated = NULL) {
$entity_type = $entity_type ?? 'api_product';
parent::__construct($values, $entity_type, $decorated);
}
/**
* {@inheritdoc}
*
* We have to override this to make it compatible with the SDK's
* entity interface that has return type hint.
*/
public function id() : ?string {
return parent::id();
}
/**
* {@inheritdoc}
*/
protected function drupalEntityId() : ?string {
return $this
->getName();
}
/**
* {@inheritdoc}
*/
protected static function decoratedClass() : string {
return EdgeApiProduct::class;
}
/**
* {@inheritdoc}
*/
public static function idProperty() : string {
return EdgeApiProduct::idProperty();
}
/**
* {@inheritdoc}
*/
public function getProxies() : array {
return $this->decorated
->getProxies();
}
/**
* {@inheritdoc}
*/
public function setProxies(string ...$proxy) : void {
$this->decorated
->setProxies(...$proxy);
}
/**
* {@inheritdoc}
*/
public function getQuota() : ?string {
return $this->decorated
->getQuota();
}
/**
* {@inheritdoc}
*/
public function setQuota(string $quota) {
$this->decorated
->setQuota($quota);
}
/**
* {@inheritdoc}
*/
public function getQuotaInterval() : ?string {
return $this->decorated
->getQuotaInterval();
}
/**
* {@inheritdoc}
*/
public function setQuotaInterval(string $quota_interval) : void {
$this->decorated
->setQuotaInterval($quota_interval);
}
/**
* {@inheritdoc}
*/
public function getQuotaTimeUnit() : ?string {
return $this->decorated
->getQuotaTimeUnit();
}
/**
* {@inheritdoc}
*/
public function setQuotaTimeUnit(string $quota_time_unit) : void {
$this->decorated
->setQuotaTimeUnit($quota_time_unit);
}
/**
* {@inheritdoc}
*/
public function getApprovalType() : ?string {
return $this->decorated
->getApprovalType();
}
/**
* {@inheritdoc}
*/
public function setApprovalType(string $approval_type) : void {
$this->decorated
->setApprovalType($approval_type);
}
/**
* {@inheritdoc}
*/
public function getApiResources() : array {
return $this->decorated
->getApiResources();
}
/**
* {@inheritdoc}
*/
public function setApiResources(string ...$api_resources) : void {
$this->decorated
->setApiResources($api_resources);
}
/**
* {@inheritdoc}
*/
public function getAttributes() : AttributesProperty {
return $this->decorated
->getAttributes();
}
/**
* {@inheritdoc}
*/
public function setAttributes(AttributesProperty $attributes) : void {
$this->decorated
->setAttributes($attributes);
}
/**
* {@inheritdoc}
*/
public function getAttributeValue(string $attribute) : ?string {
return $this->decorated
->getAttributeValue($attribute);
}
/**
* {@inheritdoc}
*/
public function setAttribute(string $name, string $value) : void {
$this->decorated
->setAttribute($name, $value);
}
/**
* {@inheritdoc}
*/
public function hasAttribute(string $name) : bool {
return $this->decorated
->hasAttribute($name);
}
/**
* {@inheritdoc}
*/
public function deleteAttribute(string $name) : void {
$this->decorated
->deleteAttribute($name);
}
/**
* {@inheritdoc}
*/
public function getCreatedAt() : ?\DateTimeImmutable {
return $this->decorated
->getCreatedAt();
}
/**
* {@inheritdoc}
*/
public function getCreatedBy() : ?string {
return $this->decorated
->getCreatedBy();
}
/**
* {@inheritdoc}
*/
public function getLastModifiedAt() : ?\DateTimeImmutable {
return $this->decorated
->getLastModifiedAt();
}
/**
* {@inheritdoc}
*/
public function getLastModifiedBy() : ?string {
return $this->decorated
->getLastModifiedBy();
}
/**
* {@inheritdoc}
*/
public function getDescription() : ?string {
return $this->decorated
->getDescription();
}
/**
* {@inheritdoc}
*/
public function setDescription(string $description) : void {
$this->decorated
->setDescription($description);
}
/**
* {@inheritdoc}
*/
public function getDisplayName() : ?string {
return $this->decorated
->getDisplayName();
}
/**
* {@inheritdoc}
*/
public function setDisplayName(string $display_name) : void {
$this->decorated
->setDisplayName($display_name);
}
/**
* {@inheritdoc}
*/
public function getEnvironments() : array {
return $this->decorated
->getEnvironments();
}
/**
* {@inheritdoc}
*/
public function setEnvironments(string ...$environments) : void {
$this->decorated
->setEnvironments(...$environments);
}
/**
* {@inheritdoc}
*/
public function getName() : ?string {
return $this->decorated
->getName();
}
/**
* {@inheritdoc}
*/
public function getScopes() : array {
return $this->decorated
->getScopes();
}
/**
* {@inheritdoc}
*/
public function setScopes(string ...$scopes) : void {
$this->decorated
->setScopes(...$scopes);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ApiProduct:: |
protected static | function |
The FQCN of the decorated class from the PHP API Client. Overrides EdgeEntityBase:: |
|
ApiProduct:: |
public | function | ||
ApiProduct:: |
protected | function |
Return the entity id used in Drupal. Overrides EdgeEntityBase:: |
|
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function |
We have to override this to make it compatible with the SDK's
entity interface that has return type hint. Overrides EdgeEntityBase:: |
|
ApiProduct:: |
public static | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function | ||
ApiProduct:: |
public | function |
ApiProduct constructor. Overrides EdgeEntityBase:: |
|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | Aliased as: traitSleep | 1 |
DependencySerializationTrait:: |
public | function | 2 | |
EdgeEntityBase:: |
protected | property | The decorated SDK entity. | 2 |
EdgeEntityBase:: |
public static | function |
Creates a Drupal entity from an SDK Entity. Overrides EdgeEntityInterface:: |
|
EdgeEntityBase:: |
public | function |
Returns the decorated SDK entity. Overrides EdgeEntityInterface:: |
2 |
EdgeEntityBase:: |
public | function | ||
EdgeEntityBase:: |
public | function | ||
EdgeEntityBase:: |
public | function | ||
EdgeEntityBase:: |
public | function |
Gets the label of the entity. Overrides EntityBase:: |
2 |
EdgeEntityBase:: |
public static | function |
Returns all unique ids how an entity can be referenced in Apigee Edge. Overrides EdgeEntityInterface:: |
2 |
EdgeEntityBase:: |
public | function |
List of unique ids how an entity can be referenced in Apigee Edge. Overrides EdgeEntityInterface:: |
|
EntityBase:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
EntityBase:: |
protected | property | The entity type. | |
EntityBase:: |
protected | property | A typed data object wrapping this entity. | |
EntityBase:: |
public | function |
Checks data value access. Overrides AccessibleInterface:: |
1 |
EntityBase:: |
public | function |
Gets the bundle of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public static | function |
Constructs a new entity object, without permanently saving it. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Creates a duplicate of the entity. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Deletes an entity permanently. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Enforces an entity to be new. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets the entity manager. | |
EntityBase:: |
protected | function | Gets the entity type bundle info service. | |
EntityBase:: |
protected | function | Gets the entity type manager. | |
EntityBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
Returns the cache tags that should be used to invalidate caches. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets the key that is used to store configuration dependencies. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the configuration dependency name. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Gets the configuration target identifier for the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Gets the entity type definition. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the ID of the type of the entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | The list cache tags to invalidate for this entity. | |
EntityBase:: |
public | function |
Gets the original ID. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Gets a typed data object for this entity object. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Indicates if a link template exists for a given key. Overrides EntityInterface:: |
|
EntityBase:: |
protected static | function | Invalidates an entity's cache tags upon delete. | 1 |
EntityBase:: |
protected | function | Invalidates an entity's cache tags upon save. | 1 |
EntityBase:: |
public | function |
Determines whether the entity is new. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets the language of the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the language manager. | |
EntityBase:: |
public | function |
Deprecated way of generating a link to the entity. See toLink(). Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets an array link templates. | 1 |
EntityBase:: |
public static | function |
Loads an entity. Overrides EntityInterface:: |
|
EntityBase:: |
public static | function |
Loads one or more entities. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Acts on a created entity before hooks are invoked. Overrides EntityInterface:: |
4 |
EntityBase:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface:: |
16 |
EntityBase:: |
public static | function |
Acts on loaded entities. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Acts on a saved entity before the insert or update hook is invoked. Overrides EntityInterface:: |
14 |
EntityBase:: |
public static | function |
Changes the values of an entity before it is created. Overrides EntityInterface:: |
5 |
EntityBase:: |
public static | function |
Acts on entities before they are deleted and before hooks are invoked. Overrides EntityInterface:: |
4 |
EntityBase:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets a list of entities referenced by this entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Saves an entity permanently. Overrides EntityInterface:: |
3 |
EntityBase:: |
public | function |
Sets the original ID. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Gets an array of all property values. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Generates the HTML for a link to this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets a list of URI relationships supported by this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the public URL for this entity. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets an array of placeholders for this entity. | 2 |
EntityBase:: |
public | function |
Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the UUID generator. | |
EntityBase:: |
public | function | 2 | |
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function | ||
RevisioningWorkaroundTrait:: |
public | function |