Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SearchPage.php

function SearchPage::postCreate

Overrides EntityBase::postCreate

File

core/modules/search/src/Entity/SearchPage.php, line 186

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;
    }
}
RSS feed
Powered by Drupal