Important

You are browsing the documentation for version 4.2 of OroCommerce, OroCRM and OroPlatform, which is no longer maintained. Read version 5.1 (the latest LTS version) of the Oro documentation to get the updated information.

See our Release Process documentation for more information on the currently supported and upcoming releases.

CLI Commands

oro:api:cache:clear

This command command clears the API cache.

Usually you need to run this command when you add a new entity to Resources/config/oro/api.yml or you add a new processor that changes a list of available via the API.

php bin/console oro:api:cache:clear

The --no-warmup option can be used to skip warming up the cache after cleaning:

php bin/console oro:api:cache:clear --no-warmup

oro:api:doc:cache:clear

This clears or warms up API documentation cache.

If this command is launched without parameters, it warm ups all API documentation caches:

php bin/console oro:api:doc:cache:clear

To clear the cache without then warming it up, use the --no-warmup option:

php bin/console oro:api:doc:cache:clear --no-warmup

To work only with the specified API documentation views use --view option:

php bin/console oro:api:doc:cache:clear --view=rest_json_api

oro:api:dump

This command shows all resources accessible via the API.

Run this command without parameters to see all available resources:

php bin/console oro:api:dump

To display resources for a particular request type, specify the --request-type option:

php bin/console oro:api:dump --request-type=rest --request-type=json_api

To show all available sub-resources, use the --sub-resources option:

php bin/console oro:api:dump --sub-resources

If you are interested in information about a particular entity, specify an entity class or entity alias as an argument:

php bin/console oro:api:dump "Oro\Bundle\UserBundle\Entity\User" --sub-resources

or

php bin/console oro:api:dump users --sub-resources

To get all entities that are not accessible via the API, see the --not-accessible option:

php bin/console oro:api:dump --not-accessible

oro:api:debug

This command shows details about registered API actions and processors.

To display all actions, run this command without parameters:

php bin/console oro:api:debug

To see the processors registered for a given action, specify the action name as an argument:

php bin/console oro:api:debug <action>

or

php bin/console oro:api:debug --no-docs <action>

The list of the processors can be limited to some group specified as the second argument:

php bin/console oro:api:debug <action> <group>

or

php bin/console oro:api:debug --no-docs <action> <group>

The –attribute option can be used to show the processors that will be executed only when the context has a given attribute with the specified value. The attribute name and value should be separated by a colon, e.g. –attribute=collection:true for a scalar value, or –attribute=extra:[definition,filters] for an array value:

php bin/console oro:api:debug --attribute=collection:true <action>

or

php bin/console oro:api:debug --attribute=extra:[definition,filters] <action>

The –processors and –processors-without-description options can be used to display all processors and all processors without descriptions respectively:

php bin/console oro:api:debug --processors

or

php bin/console oro:api:debug --processors-without-description

The –request-type option can limit the scope to the specified request type(s). Omitting this option is equivalent to –request-type=rest –request-type=json_api. Available types: rest, json_api, batch, or use any to include all request types:

php bin/console oro:api:debug --request-type=rest other options and arguments
php bin/console oro:api:debug --request-type=json_api other options and arguments
php bin/console oro:api:debug --request-type=batch other options and arguments
php bin/console oro:api:debug --request-type=any other options and arguments

oro:api:config:dump

This command shows configuration for a particular entity.

Execute this command with an entity class or entity alias specified as an argument:

php bin/console oro:api:config:dump "Oro\Bundle\UserBundle\Entity\User"

or

php bin/console oro:api:config:dump users

To display the configuration used for a particular action, use the --action option (please note that the default value for this option is get):

php bin/console oro:api:config:dump users --action=update

To display the configuration for a particular request type you can use the request-type option:

php bin/console oro:api:config:dump users --request-type=rest --request-type=json_api

By default no extra configuration data are added into output, but they can be added with the --extra option. The value for extra option can be: actions, definition, filters, sorters, descriptions or the full name of a class implements ConfigExtraInterface, e.g.

php bin/console oro:api:config:dump users --extra=filters --extra=sorters

To display the human-readable representation of an entity and its fields:

php bin/console oro:api:config:dump users --extra=descriptions

If a new extra section was added, pass the FQCN of a ConfigExtra:

php bin/console oro:api:config:dump users --extra="Acme\Bundle\AcmeBundle\Config\AcmeConfigExtra"

You can pass multiple options:

php bin/console oro:api:config:dump users --extra=sorters --extra=descriptions --extra=filters --extra="Acme\Bundle\AcmeBundle\Config\AcmeConfigExtra"

oro:api:metadata:dump

This command shows metadata for a particular entity.

To display the metadata, run this command with an entity class or entity alias specified as an argument:

php bin/console oro:api:metadata:dump "Oro\Bundle\UserBundle\Entity\User"

or

php bin/console oro:api:metadata:dump users

To display the entity metadata used for a particular action, use the --action option (please note that the default value for this option is get):

php bin/console oro:api:metadata:dump users --action=update

To display the entity metadata used for a particular request type, use the --request-type option:

php bin/console oro:api:metadata:dump users --request-type=rest --request-type=json_api

To include the HATEOAS links to the metadata, use the --hateoas option:

php bin/console oro:api:metadata:dump --hateoas <entity>

oro:api:config:dump-reference

This command shows the structure of Resources/config/oro/api.yml.

php bin/console oro:api:config:dump-reference

The –max-nesting-level option can be used to limit the depth of nesting target entities:

php bin/console oro:api:config:dump-reference --max-nesting-level=<number>

oro:cron:api:async_operations:cleanup

This command deletes all obsolete asynchronous operations used by Batch API.

php bin/console oro:cron:api:async_operations:cleanup

To show the number of obsolete asynchronous operations without the deletion of them, use the --dry-run option:

php bin/console oro:cron:api:async_operations:cleanup --dry-run