function Module::canUpdate

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::canUpdate()
  2. 10 core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::canUpdate()
  3. 11.x core/lib/Drupal/Core/Updater/Module.php \Drupal\Core\Updater\Module::canUpdate()

Determines whether this class can update the specified project.

Parameters

string $project_name: The project to check.

Return value

bool

1 call to Module::canUpdate()
Module::getSchemaUpdates in core/lib/Drupal/Core/Updater/Module.php
Returns available database schema updates once a new version is installed.

File

core/lib/Drupal/Core/Updater/Module.php, line 75

Class

Module
Defines a class for updating modules.

Namespace

Drupal\Core\Updater

Code

public static function canUpdate($project_name) {
    return (bool) \Drupal::service('extension.list.module')->getPath($project_name);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.