PHP Class Neos\Flow\Command\DoctrineCommandController

Inheritance: extends Neos\Flow\Cli\CommandController
Mostrar archivo Open project: neos/flow-development-collection

Protected Properties

Property Type Description
$doctrineService Neos\Flow\Persistence\Doctrine\Service
$packageManager Neos\Flow\Package\PackageManagerInterface
$settings array
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Public Methods

Method 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

Protected Methods

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

Method Details

compileProxiesCommand() public method

Compile the Doctrine proxy classes
public compileProxiesCommand ( ) : void
return void

createCommand() public method

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
return void

dqlCommand() public method

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
return void

emitAfterDatabaseMigration() protected method

protected emitAfterDatabaseMigration ( ) : void
return void

entityStatusCommand() public method

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
return void

handleException() protected method

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

injectSettings() public method

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

isDatabaseConfigured() protected method

protected isDatabaseConfigured ( )

migrateCommand() public method

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
return void

migrationExecuteCommand() public method

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
return void

migrationGenerateCommand() public method

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
return void

migrationStatusCommand() public method

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)
return void

migrationVersionCommand() public method

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
return void

updateCommand() public method

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
return void

validateCommand() public method

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
return void

Property Details

$doctrineService protected_oe property

protected Service,Neos\Flow\Persistence\Doctrine $doctrineService
return Neos\Flow\Persistence\Doctrine\Service

$packageManager protected_oe property

protected PackageManagerInterface,Neos\Flow\Package $packageManager
return Neos\Flow\Package\PackageManagerInterface

$settings protected_oe property

protected array $settings
return array

$systemLogger protected_oe property

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
return Neos\Flow\Log\SystemLoggerInterface