You are here

public function AppStorage::loadUnchanged in Apigee Edge 8

Loads an unchanged entity from the database.

@todo Remove this method once we have a reliable way to retrieve the unchanged entity from the entity object.

Parameters

mixed $id: The ID of the entity to load.

Return value

\Drupal\Core\Entity\EntityInterface|null The unchanged entity, or NULL if the entity cannot be loaded.

Overrides EdgeEntityStorageBase::loadUnchanged

File

src/Entity/Storage/AppStorage.php, line 84

Class

AppStorage
Base entity storage class for developer and team (company) app entities.

Namespace

Drupal\apigee_edge\Entity\Storage

Code

public function loadUnchanged($id) {

  // Clear the app controller's cache if it has one.
  if ($this->appController instanceof EntityCacheAwareControllerInterface) {

    // Id could be an UUID or an app name.
    // We do not know who is the owner so we have need the app object to be
    // invalidate the app cache entry by the app id (UUID).

    /** @var \Apigee\Edge\Api\Management\Entity\AppInterface $entity */
    $entity = $this
      ->entityController()
      ->load($id);
    $this->appController
      ->entityCache()
      ->removeEntities([
      $entity
        ->getAppId(),
    ]);
  }
  return parent::loadUnchanged($id);
}