2017 © Pedro Peláez
 

symfony-bundle platform-user-bundle

DigitalState User Bundle

image

digitalstate/platform-user-bundle

DigitalState User Bundle

  • Tuesday, February 21, 2017
  • by ds
  • Repository
  • 2 Watchers
  • 0 Stars
  • 153 Installations
  • PHP
  • 2 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

Platform-User-Bundle

The User bundle extends the OroUserBundle and provides the developers additional core user functionality., (*1)

Code Climate Test Coverage, (*2)

Table of Contents

Data Resolvers

This bundle introduces another type of data resolver based on current session data, instead of the database., (*3)

Example:, (*4)

<?php

namespace Gov\Bundle\DemoBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;

class DemoController extends Controller
{
    public function demoAction()
    {
        $data = $this->get('ds.data.data');
        $username = $data->resolve('ds.session.user.username');
    }
}

A typical use case would be when you wish to pre-populate a form with session data., (*5)

Example:, (*6)

<?php

namespace Gov\Bundle\DemoBundle\Form\Type;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;

class DemoType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder->add('username', 'text', [
            'data' => 'ds.session.user.username',
            'resolve' => true
        ]);
    }
}

Migration Extensions

This bundle introduces a collection of convenient migration extensions to help with loading yml-based data fixtures., (*7)

Example:, (*8)

<?php

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

use Doctrine\Common\DataFixtures\AbstractFixture;
use Ds\Bundle\UserBundle\Migration\Extension\UserExtensionAwareInterface;
use Ds\Bundle\UserBundle\Migration\Extension\UserExtensionAwareTrait;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Symfony\Component\DependencyInjection\ContainerAwareTrait;
use Doctrine\Common\Persistence\ObjectManager;

class LoadUserData extends AbstractFixture implements UserExtensionAwareInterface, ContainerAwareInterface
{
    use UserExtensionAwareTrait;
    use ContainerAwareTrait;

    public function load(ObjectManager $manager)
    {
        // Currently extensions are not automatically injected via the *AwareInterface.
        $this->setUserExtension($this->container->get('ds.user.migration.extension.user'));
        //

        $resource = __DIR__.'/../../../Resources/data/users.yml';
        $this->userExtension->import($resource, $manager);
    }
}
users:
    -
        username: john
        password: john
        email: john@gov.com
        roles: [ ROLE_USER ]
        first_name: John
        last_name: Doe

prototype:
    email: ~
    roles: []
    first_name: ~
    last_name: ~
    owner: main
    business_units: [ main ]
    organization: default
    organizations: [ default ]
    enabled: true

Todo

The Versions

21/02 2017

dev-master

9999999-dev https://github.com/DigitalState/Platform-User-Bundle.git

DigitalState User Bundle

  Sources   Download

MIT

The Requires

 

communication oro

21/02 2017

dev-develop

dev-develop https://github.com/DigitalState/Platform-User-Bundle.git

DigitalState User Bundle

  Sources   Download

MIT

The Requires

 

communication oro

21/02 2017
09/02 2017
20/01 2017
16/01 2017
10/01 2017