You are here

public function Purge::validate in Purge 7.2

Does basic dependency checks for builtin dependencies.

5 methods override Purge::validate()
PurgeDepend::validate in includes/purge.class.inc
Validates the dependency.
PurgeDomain::validate in includes/purge.class.inc
Validate the domains.
PurgePurgerBundleAPI::validate in includes/purge.class.inc
Validates the bundle.
PurgeQueueRunner::validate in includes/purge.class.inc
Validates all depedencies.
PurgeTarget::validate in includes/purge.class.inc
Validate

File

includes/purge.class.inc, line 150
Contains all class and interface definitions for Purge.

Class

Purge
Class for purge configuration management.

Code

public function validate() {
  $errors = array();

  // Check if we're a Dependable item or if we have dependencies in the items.
  if ($this instanceof PurgeDependable || count($this->item['depend']) > 0) {

    // Check if we have depend objects on board.
    if (count($this->depend) > 0) {
      foreach ($this->depend as $depend_name => $depend) {
        $depend_errors = array();
        $depend_errors = $depend
          ->validate();
        foreach ($depend_errors as $depend_error) {
          $errors[] = $depend_error;
        }
      }
    }
  }
  return $errors;
}