PHP code example of sideclick / entity-helper-bundle

1. Go to this page and download the library: Download sideclick/entity-helper-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/ */

    

sideclick / entity-helper-bundle example snippets

 php

// app/AppKernel.php

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

//YourBundle\Entity\Entity\Helper\UserHelper.php

namespace YourBundle\Entity\Helper;

use Sideclick\EntityHelperBundle\Entity\Helper\HelperAbstract;
use YourBundle\Entity\User;

class UserHelper extends HelperAbstract
{
    protected $_user;

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

}
 php
$userHelper = $this->get('sideclick_entity_helper.entity_helper_factory')->getEntityHelper($user);