digitalstate/platform-organization-bundle

DigitalState Organization Bundle

0.3.0 2017-02-21 00:36 UTC

This package is not auto-updated.

Last update: 2024-10-26 20:32:27 UTC


README

The Organization bundle extends the OroOrganizationBundle and provides the developers additional core organization functionality.

Code Climate Test Coverage

Table of Contents

Migration Extensions

This bundle introduces a collection of convenient migration extensions to help with loading yml-based data fixtures.

Example:

<?php

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);
    }
}
business_units:
    -
        name: Public Works
    -
        name: Finance
    -
        name: Human Resources

prototype:
    name: ~
    phone: ~
    website: ~
    email: ~
    fax: ~
    organization: default
    parent: ~

Todo