PHP code example of dbp / relay-base-organization-connector-campusonline-bundle

1. Go to this page and download the library: Download dbp/relay-base-organization-connector-campusonline-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

dbp / relay-base-organization-connector-campusonline-bundle example snippets


...
Dbp\Relay\BasePersonBundle\DbpRelayBaseOrganizationBundle::class => ['all' => true],
Dbp\Relay\BasePersonBundle\DbpRelayBaseOrganizationConnectorCampusonlineBundle::class => ['all' => true],
...


namespace App\EventSubscriber;

use Dbp\Relay\BaseOrganizationConnectorCampusonlineBundle\Event\OrganizationPostEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class OrganizationEventSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents(): array
    {
        return [
            OrganizationPostEvent::NAME => 'onPost',
    ];
    }

    public function onPost(OrganizationPostEvent $event)
    {
        $organization = $event->getOrganization();
        $organizationData = $event->getOrganizationUnitData();
        $organization->trySetLocalDataValue('code', $organizationData->getCode());
    }
}