You are here

public function SearchPage::postCreate in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/search/src/Entity/SearchPage.php \Drupal\search\Entity\SearchPage::postCreate()

Acts on an entity after it is created but before hooks are invoked.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

Overrides Entity::postCreate

File

core/modules/search/src/Entity/SearchPage.php, line 179
Contains \Drupal\search\Entity\SearchPage.

Class

SearchPage
Defines a configured search page.

Namespace

Drupal\search\Entity

Code

public function postCreate(EntityStorageInterface $storage) {
  parent::postCreate($storage);

  // @todo Use self::applyDefaultValue() once
  //   https://www.drupal.org/node/2004756 is in.
  if (!isset($this->weight)) {
    $this->weight = $this
      ->isDefaultSearch() ? -10 : 0;
  }
}