2017 © Pedro Peláez
 

package entity-helper-bundle

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle

image

sideclick/entity-helper-bundle

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle

  • Wednesday, December 7, 2016
  • by RowanReid
  • Repository
  • 2 Watchers
  • 2 Stars
  • 29 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 4 % Grown

The README.md

EntityHelperBundle

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle, (*1)

Installation

Step 1: Add the following to the "require" section of composer.json

"sideclick/entity-helper-bundle": "dev-master"

OR just require the bundle from the commandline, (*2)

composer require sideclick/entity-helper-bundle

Step 2: Enable the bundle

Enable the bundle in the kernel:, (*3)

``` php <?php // app/AppKernel.php, (*4)

public function registerBundles() { $bundles = array( // ... new Sideclick\EntityHelperBundle\SideclickEntityHelperBundle(), ); }, (*5)

## Usage

Entity helper classes should be defined in the /Entity/Helper directory of your bundle, here is the basic structure of an Entity Helper class for an entity named 'User':

//YourBundle\Entity\Entity\Helper\UserHelper.php, (*6)

namespace YourBundle\Entity\Helper;, (*7)

use Sideclick\EntityHelperBundle\Entity\Helper\HelperAbstract; use YourBundle\Entity\User;, (*8)

class UserHelper extends HelperAbstract { protected $_user;, (*9)

public function setUser(User $user)
{
    $this->_user = $user;
}

}, (*10)


There is a service named sideclick_entity_helper.entity_helper_factory which makes it easy to get an instance of an Entity Helper for an object, for example, in your controller you could do: ``` php $userHelper = $this->get('sideclick_entity_helper.entity_helper_factory')->getEntityHelper($user);

Also, there is a twig function to get a helper in your templates:, (*11)

twig get_entity_helper(user), (*12)

More documentation to come..., (*13)

The Versions

07/12 2016

dev-master

9999999-dev

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle

  Sources   Download

MIT

The Requires

 

by Rowan Reid

07/12 2016

0.1.3

0.1.3.0

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle

  Sources   Download

MIT

The Requires

 

by Rowan Reid

15/09 2016

0.1.2

0.1.2.0

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle

  Sources   Download

MIT

The Requires

 

by Rowan Reid

15/09 2016

0.1.1

0.1.1.0

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle

  Sources   Download

MIT

The Requires

 

by Rowan Reid

14/09 2016

0.1.0

0.1.0.0

Bundle for Symfony 2.6+ which introduces entity helper classes for each Doctrine entity in your bundle

  Sources   Download

MIT

The Requires

 

by Rowan Reid