You are here

function entity_update_help in Entity Update 8

Same name and namespace in other branches
  1. 2.0.x entity_update.module \entity_update_help()

Implements hook_help().

Display help page.

File

./entity_update.module, line 19
Entity update module (entity_update).

Code

function entity_update_help($route_name, RouteMatchInterface $route_match) {
  if ($route_name == 'help.page.entity_update') {
    $current_url = Url::fromRoute('<current>');
    if (strstr($current_url
      ->toString(), '/admin/help/entity_update') === FALSE) {
      return TRUE;
    }
    $doclinks = <<<TEXT

<h3>Documentation</h3>
  <ul>
    <li><a href='https://www.drupal.org/docs/8/modules/entity-update'>Entity Update documentation</a></li>
    <li><a href='https://www.drupal.org/docs/8/modules/entity-update/entity-update-from-drush'>Entity Update from drush</a></li>
    <li><a href='https://www.drupal.org/docs/8/modules/entity-update/entity-update-usage-from-web-browser'>Entity Update usage from web browser</a></li>
    <li><a href='https://www.drupal.org/docs/8/modules/entity-update/update-entities-programmatically'>Update entities programmatically</a></li>
  </ul>
TEXT;
    $output = <<<TEXT
<h3>About</h3>
<p>The main objective of the module Entity Update is allowed module developer and site administrators to update entity types schema even entities have data.
The update can execute by drush command (recommended), from web browser or Programmatically. </p>
<p>
<b>CAUTION !!!</b>
<br>- The entity update may damage your database, therefor backup the database before any action.
<br>- For the production sites, Test twice on a nonproduction site and put the site into maintain mode before any execution.
<br>- If you use this module, you are conscience what you are doing.
<br>  <b>You are the responsible of your work</b>.
</p>

{<span class="php-variable">$doclinks</span>}

<h3>Usage Examples : entity-update (Via drush)</h3>
<p>
Drush command : <b>entity-update</b><br>
Alias : <b>upe</b>
<br><br>
1. Show Entities to update<br>
<code>drush upe --show</code><br>
<br>
2. Update All Entities.<br>
<code>drush upe --all</code><br>
<br>
3. Update without automatic database backup (Not recommended for --all, suitable for --basic)<br>
<code>drush upe --basic --nobackup</code><br>
<br>
4. Cleanup entity backup database
<code>drush upe --clean</code><br>
</p>


<h3>Usage Examples : entity-update (Via drush)</h3>
<p>
This command allow to show entities and entity types via drush.<br>
Drush command : <b>entity-check</b><br>
Alias : <b>upec</b><br>
<br><br>
1. Show The summery of an entity type.<br>
<code>drush upec node</code><br>
<br>
2. Show all entity types contains "block".<br>
<code>drush upec block --types</code><br>
<br>
3. Show 3 entities from 2 of the type 'node'.<br>
<code>drush upec node --list --start=2 --length=3</code><br>
</p>

<b><i>Visit the documentation for more examples</i></b>.
{<span class="php-variable">$doclinks</span>}
TEXT;
    return $output;
  }
}