Last active
November 6, 2015 09:42
-
-
Save hugeval/d06c1c07fb80b09caa8c to your computer and use it in GitHub Desktop.
bad_practices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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