PHP code example of digitalstate / platform-organization-bundle

1. Go to this page and download the library: Download digitalstate/platform-organization-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/ */

    

digitalstate / platform-organization-bundle example snippets




namespace Gov\Bundle\DemoBundle\Migrations\Data\ORM;

use Doctrine\Common\DataFixtures\AbstractFixture;
use Ds\Bundle\OrganizationBundle\Migration\Extension\BusinessUnitExtensionAwareInterface;
use Ds\Bundle\OrganizationBundle\Migration\Extension\BusinessUnitExtensionAwareTrait;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Doctrine\Common\Persistence\ObjectManager;

class LoadBusinessUnitData extends AbstractFixture implements BusinessUnitExtensionAwareInterface, ContainerAwareInterface
{
    use BusinessUnitExtensionAwareTrait;
    use ContainerAwareTrait;

    public function load(ObjectManager $manager)
    {
        // Currently extensions are not automatically injected via the *AwareInterface.
        $this->setBusinessUnitExtension($this->container->get('ds.organization.migration.extension.business_unit'));
        //
        
        $resource = __DIR__.'/../../../Resources/data/business_unit.yml';
        $this->businessUnitExtension->import($resource, $manager);
    }
}