Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Commits
b8c062c0
Commit
b8c062c0
authored
Mar 29, 2014
by
Alex Pott
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#2157467
by Xano, Berdir: Fix type hinting for base entity interfaces.
parent
9e72c8bf
No related branches found
No related tags found
2 merge requests
!7452
Issue #1797438. HTML5 validation is preventing form submit and not fully...
,
!789
Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
+26
-3
26 additions, 3 deletions
core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
core/lib/Drupal/Core/Entity/EntityInterface.php
+9
-9
9 additions, 9 deletions
core/lib/Drupal/Core/Entity/EntityInterface.php
with
35 additions
and
12 deletions
core/lib/Drupal/Core/Config/Entity/ConfigEntityInterface.php
+
26
−
3
View file @
b8c062c0
...
@@ -61,14 +61,37 @@ public function setSyncing($status);
...
@@ -61,14 +61,37 @@ public function setSyncing($status);
* checking and managing the status.
* checking and managing the status.
*
*
* @return bool
* @return bool
* Whether the entity is enabled or not.
*/
*/
public
function
status
();
public
function
status
();
/**
/**
* Returns whether the configuration entity is created, updated or deleted
* Returns whether this entity is being changed as part of an import process.
* through the import process.
*
* If you are writing code that responds to a change in this entity (insert,
* update, delete, presave, etc.), and your code would result in a
* configuration change (whether related to this configuration entity, another
* configuration entity, or non-entity configuration) or your code would
* result in a change to this entity itself, you need to check and see if this
* entity change is part of an import process, and skip executing your code if
* that is the case.
*
* For example, \Drupal\node\Entity\NodeType::postSave() adds the default body
* field to newly created node type configuration entities, which is a
* configuration change. You would not want this code to run during an import,
* because imported entities were already given the body field when they were
* originally created, and the imported configuration includes all of their
* currently-configured fields. On the other hand,
* \Drupal\field\Entity\Field::preSave() and the methods it calls make sure
* that the storage tables are created or updated for the field configuration
* entity, which is not a configuration change, and it must be done whether
* due to an import or not. So, the first method should check
* $entity->isSyncing() and skip executing if it returns TRUE, and the second
* should not perform this check.
*
*
* @return bool
* @return bool
* TRUE if the configuration entity is being created, updated, or deleted
* through the import process.
*/
*/
public
function
isSyncing
();
public
function
isSyncing
();
...
@@ -98,7 +121,7 @@ public function isUninstalling();
...
@@ -98,7 +121,7 @@ public function isUninstalling();
* The name of the property that should be returned.
* The name of the property that should be returned.
*
*
* @return mixed
* @return mixed
* The property
,
if exist
ing,
NULL otherwise.
* The property if
it
exist
s, or
NULL otherwise.
*/
*/
public
function
get
(
$property_name
);
public
function
get
(
$property_name
);
...
...
This diff is collapsed.
Click to expand it.
core/lib/Drupal/Core/Entity/EntityInterface.php
+
9
−
9
View file @
b8c062c0
...
@@ -223,7 +223,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE);
...
@@ -223,7 +223,7 @@ public function postSave(EntityStorageInterface $storage, $update = TRUE);
*
*
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* @param \Drupal\Core\Entity\EntityStorageInterface $storage
* The entity storage object.
* The entity storage object.
* @param
array
$values
* @param
mixed[]
$values
* An array of values to set, keyed by property name. If the entity type has
* An array of values to set, keyed by property name. If the entity type has
* bundles the bundle key has to be specified.
* bundles the bundle key has to be specified.
*/
*/
...
@@ -232,7 +232,7 @@ public static function preCreate(EntityStorageInterface $storage, array &$values
...
@@ -232,7 +232,7 @@ public static function preCreate(EntityStorageInterface $storage, array &$values
/**
/**
* Acts on an entity after it is created but before hooks are invoked.
* Acts on an entity after it is created but before hooks are invoked.
*
*
* @param EntityStorageInterface $storage
* @param
\Drupal\Core\Entity\
EntityStorageInterface $storage
* The entity storage object.
* The entity storage object.
*/
*/
public
function
postCreate
(
EntityStorageInterface
$storage
);
public
function
postCreate
(
EntityStorageInterface
$storage
);
...
@@ -242,7 +242,7 @@ public function postCreate(EntityStorageInterface $storage);
...
@@ -242,7 +242,7 @@ public function postCreate(EntityStorageInterface $storage);
*
*
* Used before the entities are deleted and before invoking the delete hook.
* Used before the entities are deleted and before invoking the delete hook.
*
*
* @param EntityStorageInterface $storage
* @param
\Drupal\Core\Entity\
EntityStorageInterface $storage
* The entity storage object.
* The entity storage object.
* @param \Drupal\Core\Entity\EntityInterface[] $entities
* @param \Drupal\Core\Entity\EntityInterface[] $entities
* An array of entities.
* An array of entities.
...
@@ -254,7 +254,7 @@ public static function preDelete(EntityStorageInterface $storage, array $entitie
...
@@ -254,7 +254,7 @@ public static function preDelete(EntityStorageInterface $storage, array $entitie
*
*
* Used after the entities are deleted but before invoking the delete hook.
* Used after the entities are deleted but before invoking the delete hook.
*
*
* @param EntityStorageInterface $storage
* @param
\Drupal\Core\Entity\
EntityStorageInterface $storage
* The entity storage object.
* The entity storage object.
* @param \Drupal\Core\Entity\EntityInterface[] $entities
* @param \Drupal\Core\Entity\EntityInterface[] $entities
* An array of entities.
* An array of entities.
...
@@ -264,7 +264,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
...
@@ -264,7 +264,7 @@ public static function postDelete(EntityStorageInterface $storage, array $entiti
/**
/**
* Acts on loaded entities.
* Acts on loaded entities.
*
*
* @param EntityStorageInterface $storage
* @param
\Drupal\Core\Entity\
EntityStorageInterface $storage
* The entity storage object.
* The entity storage object.
* @param \Drupal\Core\Entity\EntityInterface[] $entities
* @param \Drupal\Core\Entity\EntityInterface[] $entities
* An array of entities.
* An array of entities.
...
@@ -284,7 +284,7 @@ public function createDuplicate();
...
@@ -284,7 +284,7 @@ public function createDuplicate();
* Returns the entity type definition.
* Returns the entity type definition.
*
*
* @return \Drupal\Core\Entity\EntityTypeInterface
* @return \Drupal\Core\Entity\EntityTypeInterface
*
E
ntity type definition.
*
The e
ntity type definition.
*/
*/
public
function
getEntityType
();
public
function
getEntityType
();
...
@@ -300,8 +300,8 @@ public function referencedEntities();
...
@@ -300,8 +300,8 @@ public function referencedEntities();
* Returns the original ID.
* Returns the original ID.
*
*
* @return int|string|null
* @return int|string|null
* The original ID,
if any. E
ntity types that do not
support renames will
* The original ID,
or NULL if no ID was set or for e
ntity types that do not
*
never have an original ID and will return NULL
.
*
support renames
.
*/
*/
public
function
getOriginalId
();
public
function
getOriginalId
();
...
@@ -319,7 +319,7 @@ public function setOriginalId($id);
...
@@ -319,7 +319,7 @@ public function setOriginalId($id);
/**
/**
* Returns an array of all property values.
* Returns an array of all property values.
*
*
* @return
array
* @return
mixed[]
* An array of property values, keyed by property name.
* An array of property values, keyed by property name.
*/
*/
public
function
toArray
();
public
function
toArray
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment