class SchemaValidator (View source)

Performs strict validation of the mapping schema

Methods

__construct(EntityManagerInterface $em)

No description

string[]
validateMapping()

Checks the internal consistency of all mapping files.

string[]
validateClass(ClassMetadata $class)

Validates a single class of the current.

bool
schemaInSyncWithMetadata()

Checks if the Database Schema is in sync with the current metadata state.

Details

__construct(EntityManagerInterface $em)

Parameters

EntityManagerInterface $em

string[] validateMapping()

Checks the internal consistency of all mapping files.

There are several checks that can't be done at runtime or are too expensive, which can be verified with this command. For example:

  1. Check if a relation with "mappedBy" is actually connected to that specified field.
  2. Check if "mappedBy" and "inversedBy" are consistent to each other.
  3. Check if "referencedColumnName" attributes are really pointing to primary key columns.

Return Value

string[]

string[] validateClass(ClassMetadata $class)

Validates a single class of the current.

Parameters

ClassMetadata $class

Return Value

string[]

bool schemaInSyncWithMetadata()

Checks if the Database Schema is in sync with the current metadata state.

Return Value

bool