Skip to content

Instantly share code, notes, and snippets.

@hugeval
Last active November 6, 2015 09:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hugeval/d06c1c07fb80b09caa8c to your computer and use it in GitHub Desktop.
Save hugeval/d06c1c07fb80b09caa8c to your computer and use it in GitHub Desktop.
bad_practices
<?php
// wrong
$entityConfig = new EntityConfigId('security', $entityClass);
$shareScopes = $this->configManager->getConfig($entityConfig)->get('share_scopes');
// correct
$shareScopes = $this->configManager->getProvider('security')->getConfig($entityClass)->get('share_scopes');
// or
$shareScopes = $this->securityConfigProvider->getConfig($entityClass)->get('share_scopes');
//
// wrong
<?php
namespace OroPro\Bundle\OrganizationBundle\Migrations\Data\ORM;
use Doctrine\Common\DataFixtures\AbstractFixture;
use Doctrine\Common\Persistence\ObjectManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\DependencyInjection\ContainerAwareInterface;
use Oro\Bundle\EntityConfigBundle\Config\ConfigManager;
class SetOrganizationShareGridConfig extends AbstractFixture implements ContainerAwareInterface
{}
// migration for update, data fixture for initialization
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment