### Comprehensive Application Installation Example (Multi-line) Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/commands.md An example demonstrating the use of multiple common options for a detailed application installation. ```none php bin/console oro:install \ -vvv \ --env=prod \ --timeout=600 \ --language=en \ --formatting-code=en_US \ --organization-name='Acme Inc.' \ --user-name=admin \ --user-email=admin@example.com \ --user-firstname=John \ --user-lastname=Doe \ --user-password='PleaseReplaceWithSomeStrongPassword' \ --application-url='http://example.com/' \ --sample-data=y ``` -------------------------------- ### Comprehensive Application Installation Example (One-liner) Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/commands.md A one-liner version of the comprehensive application installation example, using multiple common options. ```none php bin/console oro:install -vvv --env=prod --timeout=600 --language=en --formatting-code=en_US --organization-name='Acme Inc.' --user-name=admin --user-email=admin@example.com --user-firstname=John --user-lastname=Doe --user-password='PleaseReplaceWithSomeStrongPassword' --application-url='http://example.com/' --sample-data=y ``` -------------------------------- ### Example Install Migration File Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/entities/migration.md An example of an install migration file that implements the Installation interface and defines methods for schema creation and versioning. ```php namespace Acme\Bundle\DemoBundle\Migrations\Schema; use Doctrine\DBAL\Schema\Schema; use Oro\Bundle\MigrationBundle\Migration\Installation; use Oro\Bundle\MigrationBundle\Migration\QueryBag; /** * Creates all tables required for the bundle. */ class AcmeDemoBundleInstaller implements Installation { #[\]Override] public function getMigrationVersion() { return 'v1_0'; } #[\]Override] public function up(Schema $schema, QueryBag $queries) { /** Tables generation **/ $this->createAcmeDemoPriorityTable($schema); $this->createAcmeDemoDocumentTable($schema); /** Foreign keys generation **/ $this->addAcmeDemoPriorityForeignKeys($schema); $this->addAcmeDemoDocumentForeignKeys($schema); $this->addAcmeDemoNotManageableEntity($schema); } private function createAcmeDemoPriorityTable(Schema $schema): void { $table = $schema->createTable('acme_demo_priority'); $table->addColumn('id', 'integer', ['autoincrement' => true]); $table->addColumn('label', 'string', ['length' => 255]); $table->setPrimaryKey(['id']); $table->addUniqueIndex(['label'], 'uidx_label_doc'); } private function createAcmeDemoDocumentTable(Schema $schema): void { $table = $schema->createTable('acme_demo_document'); $table->addColumn('id', 'integer', ['autoincrement' => true]); $table->addColumn('subject', 'string', ['length' => 255]); $table->addColumn('description', 'string', ['length' => 255]); $table->addColumn('organization_id', 'integer', ['notnull' => false]); $table->addColumn('priority_id', 'integer', ['notnull' => false]); $table->setPrimaryKey(['id']); } private function addAcmeDemoDocumentForeignKeys(Schema $schema): void { $table = $schema->getTable('acme_demo_document'); $table->addForeignKeyConstraint( $schema->getTable('acme_demo_priority'), ['priority_id'], ['id'], ['onUpdate' => null, 'onDelete' => 'SET NULL'] ); } } ``` -------------------------------- ### Install Docker and Start Daemon Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/dev-environment/mac.md Installs Docker and Docker Compose, then launches the Docker application. ```shell brew cask install docker open /Applications/Docker.app ``` -------------------------------- ### Example Composer Install Command Source: https://github.com/oroinc/documentation-markdown/blob/7.0/cloud/maintenance/advanced-use.md Demonstrates the basic format for running composer install with optional environment variables and verbose output. ```bash {{composer_cmd}} install –no-dev -vvv ``` -------------------------------- ### PHP Listener for Installation Finish Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/index.md Implement a PHP class to handle the `installer.finish` event. This is useful for performing final setup tasks or notifications after installation. ```php namespace Acme\Bundle\DemoBundle\EventListener; class MyListener { public function onFinish() { // do something } } ``` -------------------------------- ### Install Oro Application Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/installation.md Run this command to start the Oro application installation process in production environment with a specified timeout. ```none php bin/console oro:install --env=prod --timeout=2000 ``` -------------------------------- ### Load Demo Data During Installation Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/demo-data.md Use the `oro:install` command with the `--sample-data=y` option to load demo data when initially installing the platform. ```bash php bin/console oro:install --sample-data=y ``` -------------------------------- ### Install with Sample Data Option Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/commands.md Specifies whether demo sample data should be loaded after the installation. ```none php bin/console oro:install --sample-data=y ``` ```none php bin/console oro:install --sample-data=n ``` -------------------------------- ### Install and Build Assets Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/AssetBundle/commands.md Installs and builds all web assets. This is a comprehensive command for setting up assets. ```bash php bin/console oro:assets:install ``` -------------------------------- ### Install with Application URL Option Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/commands.md Specifies the URL at which the back-office of the application will be available during installation. ```none php bin/console oro:install --application-url= ``` ```none php bin/console oro:install --application-url='http://example.com/' ``` -------------------------------- ### Install with Timeout Option Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/commands.md Limits the execution time of child commands during installation. ```none php bin/console oro:install --timeout= other options ``` -------------------------------- ### Install Oro Application Dependencies Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/get-source-files.md After cloning the repository, navigate to the application root and run this command to install all dependencies. Use '--prefer-dist --no-dev' for optimal installation. ```bash cd composer install --prefer-dist --no-dev ``` -------------------------------- ### Install Redis Server Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/RedisConfigBundle/configure-redis-servers.md Installs the redis-server package on Ubuntu Xenial or later using apt. ```bash sudo apt install redis-server ``` -------------------------------- ### Install k6 on Windows Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/automated-tests/k6-performance-tests.md Installs k6 on Windows using the Windows Package Manager (winget). ```bash winget install k6 ``` -------------------------------- ### Application Package Deployment and Upgrade Examples Source: https://github.com/oroinc/documentation-markdown/blob/7.0/cloud/maintenance/basic-use.md Provides examples of building, listing, and deploying application packages. It demonstrates the workflow for creating a package in a staging environment and then deploying it to production. ```bash # at ocom-proj-stag1 $ orocloud-cli app:package:build 5.1.0 --label=GA\ Release $ orocloud-cli app:package:list +---------------------+--------------------------+-----------------------------------------------------------------------------------------------+------------+ | Created At | Environment | Package | Label | +---------------------+--------------------------+-----------------------------------------------------------------------------------------------+------------+ | 2023-03-21 20:37:28 | ocom-proj-stag1-reg1 | harborio.oro.cloud/ocom-proj-stag1-reg1/orocommerce:5_1_0 | GA Release | $ orocloud-cli app:package:deploy --rolling harborio.oro.cloud/ocom-proj-stag1-reg1/orocommerce:5_1_0 # later at ocom-proj-prod1 $ orocloud-cli app:package:deploy --rolling harborio.oro.cloud/ocom-proj-stag1-reg1/orocommerce:5_1_0 ``` -------------------------------- ### Curl GET Request Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/api/index.md Example of a GET request to retrieve a user resource using curl. Ensure to replace '...' with your actual authorization token. ```http GET /api/users/1 HTTP/1.1 curl -X "GET" -H "Accept: application/vnd.api+json" -H "Authorization: Bearer ..." http://localhost.com/api/users/1 ``` -------------------------------- ### Basic Application Installation Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/commands.md Installs the application with all schema and data migrations, prepares assets and application caches. ```none php bin/console oro:install ``` -------------------------------- ### Valid GET Request Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/api/client-requirements.md A GET request must include the 'Accept' header with the JSON:API media type. ```http GET /api/users HTTP/1.1 Accept: application/vnd.api+json ``` -------------------------------- ### Install PNPM Globally Source: https://github.com/oroinc/documentation-markdown/blob/7.0/frontend/pnpm-package-manager.md Installs the PNPM package manager globally on your system. This is the recommended quick setup for most JavaScript developers. ```bash npm install -g pnpm ``` -------------------------------- ### Listen to Database Preparation Events Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/index.md Subscribe to `installer.database_preparation.before` or `installer.database_preparation.after` events to execute custom logic before or after database manipulations during installation. ```yaml services: Acme\Bundle\DemoBundle\EventListener\MyListener: tags: - { name: kernel.event_listener, event: installer.database_preparation.after, method: onAfterDatabasePreparation } ``` -------------------------------- ### Get Previously Purchased Products Start Date String Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/commerce/OrderBundle/previously-purchased-products.md Retrieves the start date in string format for previously purchased products. This is useful for filtering or displaying date-related information. ```php $this->get('oro_order.previously_purchased.configuration')->getPreviouslyPurchasedStartDateString() ``` -------------------------------- ### Install Docker and Docker Compose on Ubuntu Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/dev-environment/ubuntu.md Sets up the Docker apt repository and installs Docker CE, CLI, containerd, buildx plugin, and Compose plugin. Adds the current user to the docker group. ```bash # Set up Docker's apt repository sudo install -m 0755 -d /etc/apt/keyrings sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc sudo chmod a+r /etc/apt/keyrings/docker.asc echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \ $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \ sudo tee /etc/apt/sources.list.d/docker.list > /dev/null sudo apt update # Install Docker and Docker Compose sudo apt -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin sudo usermod -aG docker $(whoami) sudo systemctl enable --now docker ``` -------------------------------- ### Run Docker Compose Application Service Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/demo-environment/docker.md Start the main application containers after initialization or installation. ```bash docker compose up application ``` -------------------------------- ### Install with Admin User Configuration Options Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/commands.md Configures the admin user account details including username, email, first name, last name, and password. ```none php bin/console oro:install --user-name= --user-email= --user-firstname= --user-lastname= --user-password= ``` -------------------------------- ### Successful Request Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/api/response-status-codes.md Demonstrates a successful GET request and its corresponding 200 OK response. ```http GET /api/users/1 HTTP/1.1 ``` ```http HTTP/1.1 200 OK Request URL: http://localhost.com/api/users/1 Request Method: GET Status Code: 200 OK Remote Address: 127.0.0.1:80 ``` -------------------------------- ### Build Documentation with Docker Source: https://github.com/oroinc/documentation-markdown/blob/7.0/community/contribute/documentation.md Run this command to generate the documentation in the local `./_build/html` directory and create a Docker image. It's essential for testing changes before submitting a pull request. ```bash docker bake --load ``` -------------------------------- ### Get Current User ID Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/jenkins.md Execute this command to find the UID of the current user, necessary for environment variable setup. ```bash $ id -u 1000 ``` -------------------------------- ### Get Symbol with String and Constant Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/LocaleBundle/number-formatting.md Retrieves a symbol from the NumberFormatter using either a string name or a predefined constant. The locale can be specified to get locale-specific values. Example shows retrieving the decimal separator symbol for decimal formatting in en_US. ```php echo $numberFormatter->getSymbol('DECIMAL_SEPARATOR_SYMBOL', 'DECIMAL', 'en_US'); // outputs: "." ``` ```php echo $numberFormatter->getSymbol("\NumberFormatter::GROUPING_SEPARATOR_SYMBOL", "\NumberFormatter::DECIMAL", 'en_US'); // outputs: "," ``` -------------------------------- ### Short Action Configuration Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/entities-data-management/workflows/elements.md A concise example of action configuration, primarily specifying parameters. ```yaml - '@alias_of_action': - some_parameters: some_value # other parameters of action ``` -------------------------------- ### Example: Total Number of Records Source: https://github.com/oroinc/documentation-markdown/blob/7.0/api/http-header-specifics.md Demonstrates how to use the 'totalCount' key in the X-Include header to get the total number of records for a resource. ```APIDOC ## GET /api/users with Total Count ### Description Retrieve the total count of resource records using the `X-Include: totalCount` header. ### Method GET ### Endpoint /api/users ### Request Headers - **Accept**: application/vnd.api+json - **X-Include**: totalCount ### Response Headers - **X-Include-Total-Count**: (integer) The total number of entities. ### Response Example (200 OK) ```http HTTP/1.1 200 OK X-Include-Total-Count: 49 Content-Type: application/vnd.api+json Date: Fri, 23 Sep 2016 12:27:05 GMT Content-Length: 585 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive ``` ``` -------------------------------- ### Get Text Attribute with String and Constant Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/LocaleBundle/number-formatting.md Retrieves a text attribute from the NumberFormatter using either a string name or a predefined constant. The locale can be specified to get locale-specific values. Example shows retrieving the negative prefix for decimal formatting in en_US. ```php echo $numberFormatter->getTextAttribute('negative_prefix', 'decimal', 'en_US'); // outputs: "-" ``` ```php echo $numberFormatter->getTextAttribute("\NumberFormatter::\NEGATIVE_PREFIX", "\NumberFormatter::CURRENCY", 'en_US'); // outputs: "($" ``` -------------------------------- ### Listen to Installation Finish Event Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/index.md Subscribe to the `installer.finish` event to execute custom logic after the entire installation process is completed. ```yaml services: Acme\Bundle\DemoBundle\EventListener\MyListener: tags: - { name: kernel.event_listener, event: installer.finish, method: onFinish } ``` -------------------------------- ### WebSocket Server Running Output (Development Mode) Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/SyncBundle/index.md This is an example of the output you might see in development mode when the WebSocket server starts successfully. ```none INFO [websocket] Starting web socket INFO [websocket] Launching Ratchet on 127.0.0.1:8080 PID: 4675 ``` -------------------------------- ### Example: Create 'default-landing' JS Build Source: https://github.com/oroinc/documentation-markdown/blob/7.0/frontend/storefront/how-to/how-to-create-extra-js-build-for-landing-page.md This is an example command to create an extra JS build named 'landing' for the 'default' theme. ```none php bin/console oro:assets:build default-landing ``` -------------------------------- ### Test Environment Configuration Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/automated-tests/functional.md Configure database and mail server connection details for the test environment in the .env-app.test.local file. ```bash ORO_DB_DSN=postgresql://root@127.0.0.1/crm_test ORO_MAILER_DSN=smtp://127.0.0.1 ``` -------------------------------- ### Use Third-Party Library in Custom Code Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/architecture/customization/index.md Example of how to use a third-party library, such as NumPHP, in your custom Oro application code after it has been installed via Composer. ```php use \NumPHP\NumArray; ... $vector = new NumArray([0.12, 6/7, -9]); ... ``` -------------------------------- ### RabbitMQ Headers Exchange Setup Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/mq/rabbit-mq/rabbitmq-exchanges.md This snippet demonstrates the command-line setup for a RabbitMQ headers exchange, including declaring the exchange, a default queue, an alternate exchange, and binding them. It also shows how to bind another queue with specific header routing arguments. ```bash # declare `oro.alternate` exchange rabbitmqadmin declare exchange --host=$HOST --user=$USER --password=$PASSWORD --vhost=$VHOST \ name="oro.alternate" type="fanout" durable=true # decalre `oro.default` exchange rabbitmqadmin declare exchange --host=$HOST --user=$USER --password=$PASSWORD --vhost=$VHOST \ name="oro.default" type="headers" durable=true \ arguments='{"alternate-exchange": "oro.alternate"}' # declare `oro.default` queue rabbitmqadmin declare queue --host=$HOST --user=$USER --password=$PASSWORD --vhost=$VHOST \ name="oro.default" durable=true arguments='{"x-max-priority": 4}' # bind `oro.alternate` exchange to `oro.default` queue rabbitmqadmin declare binding --host=$HOST --user=$USER --password=$PASSWORD --vhost=$VHOST \ source="oro.alternate" destination="oro.default" destination_type="queue" # declare `oro.search` queue rabbitmqadmin declare queue --host=$HOST --user=$USER --password=$PASSWORD --vhost=$VHOST \ name="oro.search" durable=true arguments='{"x-max-priority": 4}' # bind `oro.default` exchange to `oro.search` queue with arguments rabbitmqadmin declare binding --host=$HOST --user=$USER --password=$PASSWORD --vhost=$VHOST \ source="oro.default" destination="oro.search" destination_type="queue" \ arguments='{"oro.message_queue.client.topic_name": "oro.website.search.indexer.reindex"}' ``` -------------------------------- ### Get Currency Symbol by Currency Code Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/LocaleBundle/locale-settings.md Fetch the currency symbol associated with a given currency code from the locale settings. For example, 'USD' maps to '$'. ```php $localeSettings = $this->get('oro_locale.settings'); // $ $symbol = $localeSettings->getCurrencySymbolByCurrency('USD'); ``` -------------------------------- ### Example: Total Number of Deleted Records Source: https://github.com/oroinc/documentation-markdown/blob/7.0/api/http-header-specifics.md Shows how to use the 'deletedCount' key in the X-Include header for DELETE operations to get the number of deleted records. ```APIDOC ## DELETE /api/users with Deleted Count ### Description Retrieve the total number of deleted records for a resource using the `X-Include: deletedCount` header with a DELETE request. ### Method DELETE ### Endpoint /api/users ### Request Headers - **Accept**: application/vnd.api+json - **X-Include**: deletedCount ### Response Headers - **X-Include-Deleted-Count**: (integer) The number of deleted entities. ### Response Example (204 No Content) ```http HTTP/1.1 204 No Content X-Include-Deleted-Count: 2 Date: Fri, 23 Sep 2016 12:38:47 GMT Content-Length: 0 Keep-Alive: timeout=5, max=100 Connection: Keep-Alive ``` ``` -------------------------------- ### Sample parameters.yml Configuration Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/dev-environment/parameters-yml.md This snippet shows a sample configuration for the parameters.yml file, demonstrating how to enable GridFS and Redis support by referencing environment variables. ```yaml parameters: # Enable GridFS support gaufrette_adapter.public: 'gridfs:%env(ORO_MONGODB_DSN_PUBLIC)%' gaufrette_adapter.private: 'gridfs:%env(ORO_MONGODB_DSN_PRIVATE)%' # Enable Redis support redis_dsn_cache: '%env(ORO_REDIS_CACHE_DSN)%' redis_dsn_doctrine: '%env(ORO_REDIS_DOCTRINE_DSN)%' redis_dsn_layout: '%env(ORO_REDIS_LAYOUT_DSN)%' ``` -------------------------------- ### Consume Messages using Consumption Layer Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/architecture/tech-stack/message-queue.md Example of setting up and running a QueueConsumer with a custom message processor. It binds a queue to the processor and starts consuming messages. ```php use Doctrine\DBAL\Configuration; use Doctrine\DBAL\DriverManager; use Oro\Component\MessageQueue\Consumption\ChainExtension; use Oro\Component\MessageQueue\Consumption\QueueConsumer; use Oro\Component\MessageQueue\Transport\Dbal\DbalConnection; $doctrineConnection = DriverManager::getConnection( ['url' => 'postgresql://user:secret@localhost/mydb'], new Configuration ); $connection = new DbalConnection($doctrineConnection, 'oro_message_queue'); $queueConsumer = new QueueConsumer($connection, new ChainExtension([])); $queueConsumer->bind('aQueue', new FooMessageProcessor()); try { $queueConsumer->consume(); } finally { $queueConsumer->getConnection()->close(); } ``` -------------------------------- ### Domain Configuration Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/cloud/maintenance/advanced-use.md Demonstrates a comprehensive domain configuration with multiple domains, redirect rules, and location-specific settings. ```yaml orocloud_options: domains: oro-cloud.com: locations_merge: true maintenance_page: 'public/oro-cloud.html' header_x_frame_app_control: true redirects_map: '/about_us_old': '/about' '/about_them_old': '/about_them' redirects_map_include: - 'redirects/website1.yml' - 'redirects/website2.yaml' - '/mnt/maint-data/redirects.yml' locations: 'de': type: 'php' location: '/de' fastcgi_param: 'WEBSITE': '$host/de' allow: - '127.0.0.1' - '127.0.0.2' deny: - 'all' 'en': type: 'php' location: '/en' fastcgi_param: 'WEBSITE': '$host/en' allow: - '127.0.0.1' - '127.0.0.2' deny: - 'all' example.com: locations_merge: false maintenance_page: 'public/example.html' header_x_frame_app_control: true redirects_map: '/about_us_old': '/about' '/about_them_old': '/about_them' redirects_map_include: - 'redirects/website3.yml' - 'redirects/website4.yaml' - '/mnt/maint-data/redirects.yml' locations: 'root': type: 'php' satisfy: any # Allow access if all (all) or at least one (any) access directive satisfied location: '~ /index\.php(/|$)' auth_basic_enable: true auth_basic_userlist: user1: ensure: 'present' password: 'password1' user2: ensure: 'absent' password: 'password2' 'admin': type: 'php' satisfy: any # Allow access if all (all) or at least one (any) access directive satisfied location: '~ /index\.php(/admin|$)' auth_basic_enable: true auth_basic_userlist: user3: ensure: 'present' password: 'password1' user4: ensure: 'absent' password: 'password2' allow: - '127.0.0.1' - '127.0.0.2' deny: - 'all' 'de': type: 'php' location: '/de' fastcgi_param: 'WEBSITE': '$host/de' allow: - '127.0.0.1' - '127.0.0.2' deny: - 'all' 'en': type: 'php' location: '/en' fastcgi_param: 'WEBSITE': '$host/en' allow: - '127.0.0.1' - '127.0.0.2' deny: - 'all' ``` -------------------------------- ### Get Number Formatter Attributes Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/LocaleBundle/number-formatting.md Shows how to retrieve specific numeric attributes of an intl NumberFormatter for a given style and locale. Examples include 'parse_int_only' and 'MAX_INTEGER_DIGITS'. ```php echo $numberFormatter->getAttribute('parse_int_only', 'decimal', 'en_US'); // outputs: 0 echo $numberFormatter->getAttribute(\NumberFormatter::MAX_INTEGER_DIGITS, \NumberFormatter::DECIMAL, 'en_US'); // outputs: 309 ``` -------------------------------- ### Full Action Configuration Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/entities-data-management/workflows/elements.md Example of a full action configuration including optional conditions, parameters, and 'break_on_failure' flag. ```yaml - '@alias_of_action': conditions: # optional condition configuration parameters: - some_parameters: some_value # other parameters of action break_on_failure: boolean # by default false ``` -------------------------------- ### Enable Attributes for an Entity Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/entities/attributes.md Configure an entity class to support attributes by adding the #[Config] attribute with 'has_attributes' set to true. This example shows the setup for the Document entity. ```php /** * ORM Entity Document. */ #[Config( defaultValues: [ 'attribute' => ['has_attributes' => true] ] )] class Document implements AttributeFamilyAwareInterface, // ... { // ... /** * @var AttributeFamily */ #[ORM\ManyToOne(targetEntity: 'Oro\Bundle\EntityConfigBundle\Attribute\Entity\AttributeFamily')] #[ORM\]JoinColumn(name: 'attribute_family_id', referencedColumnName: 'id', onDelete: 'RESTRICT')] #[ConfigField(defaultValues: ['dataaudit' => ['auditable' => false], 'importexport' => ['order' => 10]])] protected $attributeFamily; /** * @param AttributeFamily $attributeFamily */ #[\]Override] public function setAttributeFamily(AttributeFamily $attributeFamily): self { $this->attributeFamily = $attributeFamily; return $this; } #[\]Override] public function getAttributeFamily(): ?AttributeFamily { return $this->attributeFamily; } } ``` -------------------------------- ### PHP Listener for Database Preparation Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/InstallerBundle/index.md Implement a PHP class to handle the `installer.database_preparation.after` event. This allows for custom actions like modifying the database or executing service commands. ```php namespace Acme\Bundle\DemoBundle\EventListener; use Oro\Bundle\InstallerBundle\InstallerEvent; class MyListener { public function onAfterDatabasePreparation(InstallerEvent $event) { // do something } } ``` -------------------------------- ### Register Processor with Request Type Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/api/how-to.md Register API processors with a specific `requestType` attribute for the `oro.api.processor` tag. This example shows how to tag a processor for the 'get' action with `requestType: erp`. ```yaml acme.api.erp.do_something: class: Acme\Bundle\DemoBundle\Api\Processor\DoSomething tags: - { name: oro.api.processor, action: get, group: initialize, requestType: erp, priority: -10 } ``` -------------------------------- ### Create Calendar Event Action Configuration Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/platform/CalendarBundle/workflow-action.md Example of how to configure the create_calendar_event workflow action. Specify required parameters like title, initiator, and start time, along with optional parameters such as guests, description, and reminders. ```yaml - '@create_calendar_event': title: 'Interview with Brenda' description: 'Interview on HR position' initiator: $currentUser guests: [$reviewer] start: $dateTime end: $dateTime attribute: $interview reminders: - method: email interval_number: 1 interval_unit: H - method: web_socket interval_number: 10 interval_unit: M ``` -------------------------------- ### Example Configuration File Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/extensions/MakerBundle/index.md Define entity structure, fields, and generation options in a YAML configuration file. ```yaml generate: options: organization: acme package: example entities: seller: configuration: owner: user fields: name: type: string required: true price: type: float description: type: html ``` -------------------------------- ### Restore Database Dump with Docker Compose Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/setup/dev-environment/setup-from-db-dump.md Restore a database dump using a default docker-compose.yml setup. This involves stopping and starting the PostgreSQL service, dropping and recreating the database, enabling extensions, and piping the SQL dump into the database. ```none # oro_db_user - oro database user # oro_db - oro database # Recreate containers in order to kill all the active db sessions docker compose stop pgsql # or docker compose down docker compose up -d # drop an old db first docker exec $(docker compose ps -q pgsql) psql -U oro_db_user -d postgres -c "DROP DATABASE oro_db;" # and recreate a fresh db docker exec $(docker compose ps -q pgsql) psql -U oro_db_user -d postgres -c "CREATE DATABASE oro_db;" docker exec $(docker compose ps -q pgsql) psql -U oro_db_user -d oro_db -c "CREATE EXTENSION IF NOT EXISTS \"uuid-ossp\";" cat /tmp/oro_db_dump.sql | docker exec -i $(docker compose ps -q pgsql) psql -U oro_db_user oro_db ``` -------------------------------- ### Install and Update for Prod Mode Source: https://github.com/oroinc/documentation-markdown/blob/7.0/bundles/commerce/CookieConsentBundle/index.md Commands to clear cache, install dependencies, update the platform, and consume messages for production mode. ```php rm -rf var/cache/* composer install --prefer-dist --no-dev php/bin/console oro:platform:update --env=prod --force php/bin/console oro:message-queue:consume --env=prod ``` -------------------------------- ### Workflow Configuration Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/entities-data-management/workflows/configuration-reference.md Defines a workflow for the Opportunity entity, specifying its activation, associated datagrids, entity attribute, system status, start step, display order, priority, exclusivity groups, application availability, scope field, and disabled operations. ```yaml workflows: b2b_flow_sales: defaults: active: true entity: Oro\Bundle\SalesBundle\Entity\Opportunity datagrids: - opportunity_grid entity_attribute: opportunity is_system: true start_step: qualify steps_display_ordered: true priority: 100 exclusive_active_groups: [b2b_sales] exclusive_record_groups: - sales applications: [webshop] scopes: - scope_field: 42 disable_operations: operation_for_simple_sale: ~ operation_create_sale: [OrderBundle\Entity\Order] ``` -------------------------------- ### Create Theme Layout Directory and Configuration File Source: https://github.com/oroinc/documentation-markdown/blob/7.0/frontend/storefront/quick-start.md Create the directories and the theme.yml file to define your new theme. ```bash mkdir -p src/Oro/Bundle/DemoThemeBundle/Resources/views/layouts/demo && \ touch src/Oro/Bundle/DemoThemeBundle/Resources/views/layouts/demo/theme.yml ``` -------------------------------- ### Install k6 on Debian/Ubuntu Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/automated-tests/k6-performance-tests.md Installs k6 on Debian/Ubuntu systems by adding the k6 repository and then installing the package. ```bash sudo gpg -k sudo gpg --no-default-keyring --keyring /usr/share/keyrings/k6-archive-keyring.gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys C5AD17C747E3415A3642D57D77C6C491D6AC1D69 echo "deb [signed-by=/usr/share/keyrings/k6-archive-keyring.gpg] https://dl.k6.io/deb stable main" | sudo tee /etc/apt/sources.list.d/k6.list sudo apt-get update sudo apt-get install k6 ``` -------------------------------- ### YAML Configuration Example Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/api/configuration-extensions.md Example of how to use the created configuration section in a YAML file to define entity configurations. ```yaml api: entities: Acme\Bundle\DemoBundle\Entity\SomeEntity: my_section: my_option: value ``` -------------------------------- ### Install Application in Test Environment Source: https://github.com/oroinc/documentation-markdown/blob/7.0/backend/automated-tests/functional.md Install the OroPlatform application in the test environment using the oro:install command. ```bash php bin/console oro:install --env=test ```