Upload
yevhen-shyshkin
View
571
Download
2
Embed Size (px)
Citation preview
OroPlatform and OroCRM from a developer's perspective
OroPlatform and OroCRM from
a developer's perspective
Yevhen [email protected]
https://github.com/yshyshkin
OroPlatform and OroCRM from a developer's perspective
Backend structure
OroPlatform and OroCRM from a developer's perspective
Backend MVC
Controller- controller class- routing- events
Model- Doctrine entities- services- events
View- twig templates- placeholders
OroPlatform and OroCRM from a developer's perspective
Frontend structure
OroPlatform and OroCRM from a developer's perspective
Frontend MVC
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
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
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 }
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
OroPlatform and OroCRM from a developer's perspective
Doctrine manipulations
OroPlatform and OroCRM from a developer's perspective
Doctrine entities
- data representation layer - not domain models - have relations between entities - have lifecycle callback events
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
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",* }* }* )
OroPlatform and OroCRM from a developer's perspective
Extended entities
$staticField1$staticField2$staticField3 . . .$extendedField1$extendedField2$extendedField3
Entity
Static Doctrine fields
Extended (dynamic)OroPlatform fields
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]]);
OroPlatform and OroCRM from a developer's perspective
Datagrids
- declarative style - use DQL to build query - can be extended - have events
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
OroPlatform and OroCRM from a developer's perspective
Workflows
BA
- entity manipulations- state machine: steps + transitions- UI management- conditions- actions
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
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...
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...
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
OroPlatform and OroCRM from a developer's perspective
Developers environment
- PHP Storm- Symfony plugin- xdebug- phpcs / phpmd / phpcpd
OroPlatform and OroCRM from a developer's perspective
Q & A