27
OroPlatform and OroCRM from a developer's perspective OroPlatform and OroCRM from a developer's perspective Yevhen Shyshkin [email protected] https://github.com/yshys hkin

OroPlatform and OroCRM from a developer's perspective

Embed Size (px)

Citation preview

Page 1: OroPlatform and OroCRM from a developer's perspective

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

OroPlatform and OroCRM from a developer's perspective

Backend structure

Page 3: OroPlatform and OroCRM from a developer's perspective

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

OroPlatform and OroCRM from a developer's perspective

Frontend structure

Page 5: OroPlatform and OroCRM from a developer's perspective

OroPlatform and OroCRM from a developer's perspective

Frontend MVC

Page 6: OroPlatform and OroCRM from a developer's perspective

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

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

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

OroPlatform and OroCRM from a developer's perspective

Page 10: OroPlatform and OroCRM from a developer's perspective

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

OroPlatform and OroCRM from a developer's perspective

Doctrine manipulations

Page 12: OroPlatform and OroCRM from a developer's perspective

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

OroPlatform and OroCRM from a developer's perspective

Page 14: OroPlatform and OroCRM from a developer's perspective

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

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

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

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

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

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

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

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

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

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

OroPlatform and OroCRM from a developer's perspective

Page 25: OroPlatform and OroCRM from a developer's perspective

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

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

OroPlatform and OroCRM from a developer's perspective

Q & A