PHP Класс Neos\Flow\Command\DoctrineCommandController

Наследование: extends Neos\Flow\Cli\CommandController
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$doctrineService Neos\Flow\Persistence\Doctrine\Service
$packageManager Neos\Flow\Package\PackageManagerInterface
$settings array
$systemLogger Neos\Flow\Log\SystemLoggerInterface

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
emitAfterDatabaseMigration ( ) : void
handleException ( Exception $exception ) : void Output an error message and log the exception.
isDatabaseConfigured ( )

Описание методов

compileProxiesCommand() публичный Метод

Compile the Doctrine proxy classes
public compileProxiesCommand ( ) : void
Результат void

createCommand() публичный Метод

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
Результат void

dqlCommand() публичный Метод

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
Результат void

emitAfterDatabaseMigration() защищенный Метод

protected emitAfterDatabaseMigration ( ) : void
Результат void

entityStatusCommand() публичный Метод

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
Результат void

handleException() защищенный Метод

Output an error message and log the exception.
protected handleException ( Exception $exception ) : void
$exception Exception
Результат void

injectSettings() публичный Метод

Injects the Flow settings, only the persistence part is kept for further use
public injectSettings ( array $settings ) : void
$settings array
Результат void

isDatabaseConfigured() защищенный Метод

protected isDatabaseConfigured ( )

migrateCommand() публичный Метод

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
Результат void

migrationExecuteCommand() публичный Метод

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
Результат void

migrationGenerateCommand() публичный Метод

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
Результат void

migrationStatusCommand() публичный Метод

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)
Результат void

migrationVersionCommand() публичный Метод

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
Результат void

updateCommand() публичный Метод

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
Результат void

validateCommand() публичный Метод

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
Результат void

Описание свойств

$doctrineService защищенное свойство

protected Service,Neos\Flow\Persistence\Doctrine $doctrineService
Результат Neos\Flow\Persistence\Doctrine\Service

$packageManager защищенное свойство

protected PackageManagerInterface,Neos\Flow\Package $packageManager
Результат Neos\Flow\Package\PackageManagerInterface

$settings защищенное свойство

protected array $settings
Результат array

$systemLogger защищенное свойство

protected SystemLoggerInterface,Neos\Flow\Log $systemLogger
Результат Neos\Flow\Log\SystemLoggerInterface