PHP Class Neos\Flow\Command\DoctrineCommandController

Inheritance: extends Neos\Flow\Cli\CommandController
Afficher le fichier Open project: neos/flow-development-collection

Protected Properties

Свойство Type Description
$doctrineService Neos\Flow\Persistence\Doctrine\Service
$packageManager Neos\Flow\Package\PackageManagerInterface
$settings array
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Méthodes publiques

Méthode Description
compileProxiesCommand ( ) : void Compile the Doctrine proxy classes
createCommand ( string $output = null ) : void Create the database schema
dqlCommand ( integer $depth = 3, string $hydrationMode = 'array', integer $offset = null, integer $limit = null ) : void Run arbitrary DQL and display results
entityStatusCommand ( boolean $dumpMappingData = false, string $entityClassName = null ) : void Show the current status of entities and mappings
injectSettings ( array $settings ) : void Injects the Flow settings, only the persistence part is kept for further use
migrateCommand ( string $version = null, string $output = null, boolean $dryRun = false, boolean $quiet = false ) : void Migrate the database schema
migrationExecuteCommand ( string $version, string $direction = 'up', string $output = null, boolean $dryRun = false ) : void Execute a single migration
migrationGenerateCommand ( boolean $diffAgainstCurrent = true, string $filterExpression = null ) : void Generate a new migration
migrationStatusCommand ( boolean $showMigrations = false, boolean $showDescriptions = false ) : void Show the current migration status
migrationVersionCommand ( string $version, boolean $add = false, boolean $delete = false ) : void Mark/unmark migrations as migrated
updateCommand ( boolean $unsafeMode = false, string $output = null ) : void Update the database schema
validateCommand ( ) : void Validate the class/table mappings

Méthodes protégées

Méthode Description
emitAfterDatabaseMigration ( ) : void
handleException ( Exception $exception ) : void Output an error message and log the exception.
isDatabaseConfigured ( )

Method Details

compileProxiesCommand() public méthode

Compile the Doctrine proxy classes
public compileProxiesCommand ( ) : void
Résultat void

createCommand() public méthode

Creates a new database schema based on the current mapping information. It expects the database to be empty, if tables that are to be created already exist, this will lead to errors.
public createCommand ( string $output = null ) : void
$output string A file to write SQL to, instead of executing it
Résultat void

dqlCommand() public méthode

Any DQL queries passed after the parameters will be executed, the results will be output: doctrine:dql --limit 10 'SELECT a FROM Neos\Flow\Security\Account a'
public dqlCommand ( integer $depth = 3, string $hydrationMode = 'array', integer $offset = null, integer $limit = null ) : void
$depth integer How many levels deep the result should be dumped
$hydrationMode string One of: object, array, scalar, single-scalar, simpleobject
$offset integer Offset the result by this number
$limit integer Limit the result to this number
Résultat void

emitAfterDatabaseMigration() protected méthode

protected emitAfterDatabaseMigration ( ) : void
Résultat void

entityStatusCommand() public méthode

Shows basic information about which entities exist and possibly if their mapping information contains errors or not. To run a full validation, use the validate command.
public entityStatusCommand ( boolean $dumpMappingData = false, string $entityClassName = null ) : void
$dumpMappingData boolean If set, the mapping data will be output
$entityClassName string If given, the mapping data for just this class will be output
Résultat void

handleException() protected méthode

Output an error message and log the exception.
protected handleException ( Exception $exception ) : void
$exception Exception
Résultat void

injectSettings() public méthode

Injects the Flow settings, only the persistence part is kept for further use
public injectSettings ( array $settings ) : void
$settings array
Résultat void

isDatabaseConfigured() protected méthode

protected isDatabaseConfigured ( )

migrateCommand() public méthode

Adjusts the database structure by applying the pending migrations provided by currently active packages.
public migrateCommand ( string $version = null, string $output = null, boolean $dryRun = false, boolean $quiet = false ) : void
$version string The version to migrate to
$output string A file to write SQL to, instead of executing it
$dryRun boolean Whether to do a dry run or not
$quiet boolean If set, only the executed migration versions will be output, one per line
Résultat void

migrationExecuteCommand() public méthode

Manually runs a single migration in the given direction.
public migrationExecuteCommand ( string $version, string $direction = 'up', string $output = null, boolean $dryRun = false ) : void
$version string The migration to execute
$direction string Whether to execute the migration up (default) or down
$output string A file to write SQL to, instead of executing it
$dryRun boolean Whether to do a dry run or not
Résultat void

migrationGenerateCommand() public méthode

If $diffAgainstCurrent is TRUE (the default), it generates a migration file with the diff between current DB structure and the found mapping metadata. Otherwise an empty migration skeleton is generated. Only includes tables/sequences matching the $filterExpression regexp when diffing models and existing schema. Include delimiters in the expression! The use of --filter-expression '/^acme_com/' would only create a migration touching tables starting with "acme_com". Note: A filter-expression will overrule any filter configured through the Neos.Flow.persistence.doctrine.migrations.ignoredTables setting
public migrationGenerateCommand ( boolean $diffAgainstCurrent = true, string $filterExpression = null ) : void
$diffAgainstCurrent boolean Whether to base the migration on the current schema structure
$filterExpression string Only include tables/sequences matching the filter expression regexp
Résultat void

migrationStatusCommand() public méthode

Displays the migration configuration as well as the number of available, executed and pending migrations.
public migrationStatusCommand ( boolean $showMigrations = false, boolean $showDescriptions = false ) : void
$showMigrations boolean Output a list of all migrations and their status
$showDescriptions boolean Show descriptions for the migrations (enables versions display)
Résultat void

migrationVersionCommand() public méthode

If all is given as version, all available migrations are marked as requested.
public migrationVersionCommand ( string $version, boolean $add = false, boolean $delete = false ) : void
$version string The migration to execute
$add boolean The migration to mark as migrated
$delete boolean The migration to mark as not migrated
Résultat void

updateCommand() public méthode

Updates the database schema without using existing migrations. It will not drop foreign keys, sequences and tables, unless --unsafe-mode is set.
public updateCommand ( boolean $unsafeMode = false, string $output = null ) : void
$unsafeMode boolean If set, foreign keys, sequences and tables can potentially be dropped.
$output string A file to write SQL to, instead of executing the update directly
Résultat void

validateCommand() public méthode

Checks if the current class model schema is valid. Any inconsistencies in the relations between models (for example caused by wrong or missing annotations) will be reported. Note that this does not check the table structure in the database in any way.
public validateCommand ( ) : void
Résultat void

Property Details

$doctrineService protected_oe property

protected Service,Neos\Flow\Persistence\Doctrine $doctrineService
Résultat Neos\Flow\Persistence\Doctrine\Service

$packageManager protected_oe property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
Résultat Neos\Flow\Package\PackageManagerInterface

$settings protected_oe property

protected array $settings
Résultat array

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Résultat Neos\Flow\Log\SystemLoggerInterface