![Page 1: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/1.jpg)
OroPlatform and OroCRM from a developer's perspective
OroPlatform and OroCRM from
a developer's perspective
Yevhen [email protected]
https://github.com/yshyshkin
![Page 2: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/2.jpg)
OroPlatform and OroCRM from a developer's perspective
Backend structure
![Page 3: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/3.jpg)
OroPlatform and OroCRM from a developer's perspective
Backend MVC
Controller- controller class- routing- events
Model- Doctrine entities- services- events
View- twig templates- placeholders
![Page 4: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/4.jpg)
OroPlatform and OroCRM from a developer's perspective
Frontend structure
![Page 5: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/5.jpg)
OroPlatform and OroCRM from a developer's perspective
Frontend MVC
![Page 6: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/6.jpg)
OroPlatform and OroCRM from a developer's perspective
Symfony basics
- composer as package manager - code packed into bundles - each bundle might provide: - entities - routing - configuration - services - tests
![Page 7: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/7.jpg)
OroPlatform and OroCRM from a developer's perspective
Dependency Injectionparameters: oro_datagrid.datagrid.manager.class: Oro\Bundle\DataGridBundle\Datagrid\Manager
services: oro_datagrid.datagrid.manager: class: %oro_datagrid.datagrid.manager.class% arguments: - @oro_datagrid.configuration.provider.chain - @oro_datagrid.datagrid.builder - @oro_datagrid.datagrid.request_parameters_factory - @oro_datagrid.datagrid.name_strategy
![Page 8: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/8.jpg)
OroPlatform and OroCRM from a developer's perspective
DI Eventsparameters: oro_datagrid.event_listener.ormdatasource_acl.class: Oro\Bundle\DataGridBundle\EventListener\OrmDatasourceAclListener
services: oro_datagrid.event_listener.ormdatasource_acl: class: %oro_datagrid.event_listener.ormdatasource_acl.class% arguments: - @oro_security.acl_helper tags: - { name: kernel.event_listener, event: oro_datagrid.orm_datasource.result.before, method: onResultBefore }
![Page 9: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/9.jpg)
OroPlatform and OroCRM from a developer's perspective
![Page 10: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/10.jpg)
OroPlatform and OroCRM from a developer's perspective
Doctrine
- ORM - operates with entities - has its own language DQL - uses UnitOfWork to perform operations - UnitOfWork has events
![Page 11: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/11.jpg)
OroPlatform and OroCRM from a developer's perspective
Doctrine manipulations
![Page 12: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/12.jpg)
OroPlatform and OroCRM from a developer's perspective
Doctrine entities
- data representation layer - not domain models - have relations between entities - have lifecycle callback events
![Page 13: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/13.jpg)
OroPlatform and OroCRM from a developer's perspective
![Page 14: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/14.jpg)
OroPlatform and OroCRM from a developer's perspective
Configurable entities
- entity and fields have additional metadata - can be modified in UI - bundles add their own configuration
![Page 15: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/15.jpg)
OroPlatform and OroCRM from a developer's perspective
Configuration example* @Config(* routeName="orocrm_contact_index",* routeView="orocrm_contact_view",* defaultValues={* "entity"={* "icon"="icon-group",* },* "form"={* "form_type"="orocrm_contact_select",* "grid_name"="contacts-select-grid",* },* "grid"={* "default"="contacts-grid",* }* }* )
![Page 16: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/16.jpg)
OroPlatform and OroCRM from a developer's perspective
Extended entities
$staticField1$staticField2$staticField3 . . .$extendedField1$extendedField2$extendedField3
Entity
Static Doctrine fields
Extended (dynamic)OroPlatform fields
![Page 17: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/17.jpg)
OroPlatform and OroCRM from a developer's perspective
Extension example$this->extendExtension->addEnumField( $schema, 'orocrm_sales_lead', 'source', 'lead_source');
$this->extendExtension->addManyToOneRelation( $schema, $table, 'campaign', 'orocrm_campaign', 'combined_name', ['extend' => ['owner' => ExtendScope::OWNER_CUSTOM]]);
![Page 18: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/18.jpg)
OroPlatform and OroCRM from a developer's perspective
Datagrids
- declarative style - use DQL to build query - can be extended - have events
![Page 19: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/19.jpg)
OroPlatform and OroCRM from a developer's perspective
Datagrid exampleroles-grid: source: type: orm query: select: - r.id - r.label from: - { table: OroUserBundle:Role, alias: r } columns: label: label: oro.user.role.label.label sorters: columns: label: data_name: r.label filters: columns: label: type: string data_name: r.label
![Page 20: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/20.jpg)
OroPlatform and OroCRM from a developer's perspective
Workflows
BA
- entity manipulations- state machine: steps + transitions- UI management- conditions- actions
![Page 21: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/21.jpg)
OroPlatform and OroCRM from a developer's perspective
Workflow definitionworkflows: task_flow: label: 'Task Flow' entity: OroCRM\Bundle\TaskBundle\Entity\Task entity_attribute: task start_step: open
![Page 22: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/22.jpg)
OroPlatform and OroCRM from a developer's perspective
Workflow stepsworkflows: task_flow: steps: open: label: 'Open' order: 10 allowed_transitions: - start_progress - close in_progress: label: 'In progress' order: 20 allowed_transitions: - stop_progress - close...
![Page 23: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/23.jpg)
OroPlatform and OroCRM from a developer's perspective
Workflow transitionsworkflows: task_flow: transitions: start_progress: label: 'Start progress' step_to: in_progress frontend_options: icon: 'icon-play' transition_definition: start_progress_definition stop_progress: label: 'Stop progress' step_to: open frontend_options: icon: 'icon-stop' transition_definition: stop_progress_definition...
![Page 24: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/24.jpg)
OroPlatform and OroCRM from a developer's perspective
![Page 25: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/25.jpg)
OroPlatform and OroCRM from a developer's perspective
What else?
- search- security- import/export- reports and segments- migrations- documentation - general and bundle- code style- tests - unit, functional, selenium
![Page 26: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/26.jpg)
OroPlatform and OroCRM from a developer's perspective
Developers environment
- PHP Storm- Symfony plugin- xdebug- phpcs / phpmd / phpcpd
![Page 27: OroPlatform and OroCRM from a developer's perspective](https://reader035.vdocuments.site/reader035/viewer/2022062223/586f83321a28ab54768b48c7/html5/thumbnails/27.jpg)
OroPlatform and OroCRM from a developer's perspective
Q & A