Sometimes you need to integrate data from external systems into your application. For example,
imagine that you have another application where tasks can be created that you want to sync with
OroCRM. OroPlatform provides means to achieve a seamless integration of other applications through
the OroIntegrationBundle.

The first step is to define a new channel. A channel is the way to make your integration visible in
the integration section of the admin interface. A channel is a class that has to implement the
ChannelInterface:

The ChannelInterface requires you to interface the getLabel() method which is a translation key
that will be shown to the user in the UI after being translated.

Additionally, you can implement the IconAwareIntegrationInterface
if you also like to display an icon. You then also need to implement the getIcon() method which
returns a path to the icon relative to the project’s web directory:

After having created the class you need to make it available in the user interface by registering
it as a service and tag it with the oro_integration.channel tag and configure the type
attribute which must be a unique value that is used internally by the OroIntegrationBundle to refer
to the channel:

For every channel you can define several ways to read the data from your external application (for
example, either via SOAP or a HTTP REST API). This concept is called a transport. A class providing
such a transport must implement the TransportInterface.
This interface requires four methods to be implemented:

init(Transport$transport)

Initializes the transport. The passed object contains the settings for this transport that was
configured using the form type identified by the name returned by getSettingsFormType(). It
is an instance of the class configured by the getSettingsEntityFQCN() method.

getLabel()

The translation key used to display the transport label in the UI.

getSettingsFormType()

The name (as returned by FormInterface::getName()) of the form type that is used to let the
user configure transport specific settings (for example, access credentials for API endpoints).

getSettingsEntityFQCN()

The fully-qualified class name of the entity that stores the settings configured through the
aforementioned form type (this should be a subclass of Transport).

Then, register your transport as a service and tag it with the oro_integration.transport tag.
Use the channel_type attribute to define the channel the transport is connected with. You need
to give the transport an identifier using the type attribute that must be unique across the
channel:

The class implementing the ConnectorInterface must then be registered as a service tagged with
oro_integration.connector. Use the channel_type attribute to define the channel that the
connector is associated with. The type attribute must get the same value that is returned by
the connector’s getType() method: