Initial Drupal 11 with DDEV setup
This commit is contained in:
46
vendor/drush/drush/drush.api.php
vendored
Normal file
46
vendor/drush/drush/drush.api.php
vendored
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Drupal hooks provided by the Drush package.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Executes a deploy function which is intended to update data, like entities,
|
||||
* after config is imported during a deployment.
|
||||
*
|
||||
* These are a higher level alternative to hook_update_n and hook_deploy_NAME
|
||||
* functions and have to be placed in a MODULE.deploy.php file.
|
||||
*
|
||||
* NAME can be arbitrary machine names. In contrast to hook_update_N() the
|
||||
* alphanumeric naming of functions in the file is the only thing which ensures
|
||||
* the execution order of those functions. If update order is mandatory,
|
||||
* you should add numerical prefix to NAME or make it completely numerical.
|
||||
*
|
||||
* Drupal also ensures to not execute the same hook_deploy_NAME() function
|
||||
* twice.
|
||||
*
|
||||
* @param array $sandbox
|
||||
* Stores information for batch updates.
|
||||
*
|
||||
* @return string|null
|
||||
* Optionally, hook_deploy_NAME() hooks may return a translated string
|
||||
* that will be displayed to the user after the update has completed. If no
|
||||
* message is returned, no message will be presented to the user.
|
||||
*
|
||||
* @throws \Exception
|
||||
* In case of error, update hooks should throw an instance of
|
||||
* \Exception with a meaningful message for the user.
|
||||
*
|
||||
* @ingroup update_api
|
||||
*
|
||||
* @see hook_update_N()
|
||||
* @see hook_post_update_NAME()
|
||||
*/
|
||||
function hook_deploy_NAME(array &$sandbox): string {
|
||||
$node = \Drupal\node\Entity\Node::load(123);
|
||||
$node->setTitle('foo');
|
||||
$node->save();
|
||||
|
||||
return t('Node %nid saved', ['%nid' => $node->id()]);
|
||||
}
|
||||
Reference in New Issue
Block a user