You are here

protected function InstallingTrait::isInstallingFromExtension in Search API 8

Determines if this config entity is being installed from an extension.

Return value

bool TRUE if the item is being installed from an extension; FALSE otherwise.

2 calls to InstallingTrait::isInstallingFromExtension()
Index::preSave in src/Entity/Index.php
Acts on an entity before the presave hook is invoked.
Server::preSave in src/Entity/Server.php
Acts on an entity before the presave hook is invoked.

File

src/Entity/InstallingTrait.php, line 16

Class

InstallingTrait
Provides a helper method for checking a saved config entity's source.

Namespace

Drupal\search_api\Entity

Code

protected function isInstallingFromExtension() {

  // A configuration item is being installed from an extension if both of the
  // following are true:
  // - It is marked as new.
  // - It has the _core property set.
  // @see \Drupal\core\Config\ConfigInstaller::installConfiguration().
  return $this
    ->isNew() && !empty($this->_core);
}