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

Breadcrumb

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

function ContentEntityBase::postSave

Overrides EntityBase::postSave

16 calls to ContentEntityBase::postSave()
BlockContent::postSave in core/modules/block_content/src/Entity/BlockContent.php
Acts on a saved entity before the insert or update hook is invoked.
BlockContent::postSave in core/modules/block_content/src/Entity/BlockContent.php
Acts on a saved entity before the insert or update hook is invoked.
Comment::postSave in core/modules/comment/src/Entity/Comment.php
Acts on a saved entity before the insert or update hook is invoked.
Comment::postSave in core/modules/comment/src/Entity/Comment.php
Acts on a saved entity before the insert or update hook is invoked.
Media::postSave in core/modules/media/src/Entity/Media.php
Acts on a saved entity before the insert or update hook is invoked.

... See full list

8 methods override ContentEntityBase::postSave()
BlockContent::postSave in core/modules/block_content/src/Entity/BlockContent.php
Acts on a saved entity before the insert or update hook is invoked.
Comment::postSave in core/modules/comment/src/Entity/Comment.php
Acts on a saved entity before the insert or update hook is invoked.
Media::postSave in core/modules/media/src/Entity/Media.php
Acts on a saved entity before the insert or update hook is invoked.
MenuLinkContent::postSave in core/modules/menu_link_content/src/Entity/MenuLinkContent.php
Acts on a saved entity before the insert or update hook is invoked.
Node::postSave in core/modules/node/src/Entity/Node.php
Acts on a saved entity before the insert or update hook is invoked.

... See full list

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 491

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);
    // Update the status of all saved translations.
    $removed = [];
    foreach ($this->translations as $langcode => &$data) {
        if ($data['status'] == static::TRANSLATION_REMOVED) {
            $removed[$langcode] = TRUE;
        }
        else {
            $data['status'] = static::TRANSLATION_EXISTING;
        }
    }
    $this->translations = array_diff_key($this->translations, $removed);
    // Reset the new revision flag.
    $this->newRevision = FALSE;
    // Reset the enforcement of the revision translation affected flag.
    $this->enforceRevisionTranslationAffected = [];
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal