You are here

class SchemaComparisonInfoBuilder in Schema 8

Hierarchy

Expanded class hierarchy of SchemaComparisonInfoBuilder

1 file declares its use of SchemaComparisonInfoBuilder
schema.module in ./schema.module
The Schema module provides functionality built on the Schema API.

File

src/Comparison/SchemaComparisonInfoBuilder.php, line 16
Contains Drupal\schema\Comparison\SchemaComparisonInfoBuilder.

Namespace

Drupal\schema\Comparison
View source
class SchemaComparisonInfoBuilder {
  protected $o;
  public function __construct(SchemaComparison $comparison) {
    $this->o = $comparison;
  }
  public function getInfoArray() {
    return $this
      ->getWarningsArray() + $this
      ->getTablesArray();
  }
  public function getWarningsArray() {
    $info = array();
    foreach ($this->o
      ->getWarnings() as $warning) {
      $info['warn'][] = $warning;
    }
    return $info;
  }
  public function getTablesArray() {
    $info = array();

    /** @var MissingTable $table */
    foreach ($this->o
      ->getMissingTables() as $table) {
      $info['missing'][$table
        ->getModule()][$table
        ->getTableName()] = array(
        'status' => 'missing',
      );
    }

    /** @var TableComparison $table */
    foreach ($this->o
      ->getComparedTables() as $table) {
      $table_info = (new TableComparisonInfoBuilder($table))
        ->getInfoArray();
      $info[$table_info["status"]][$table
        ->getModule()][$table
        ->getTableName()] = $table_info;
    }

    /** @var ExtraTable $table */
    foreach ($this->o
      ->getExtraTables() as $table) {
      $info['extra'][] = $table
        ->getTableName();
    }
    return $info;
  }

}

Members