@param mixed  $model
@param string $manager (optional)

@return mixed
338852
public function getIdentifierValue($model, $manager = null)
    {
        $field = (null !== $manager)? $this->getIdentifierReference($manager)->referenceField : $this->identifierField;

        return $model->{'get' . ucfirst($field)}();
    }
1213023
public function load(ObjectManager $manager)
    {
        $gal = new Folder();
        $gal->setRel(Folder::TYPE_MEDIA);
        $gal->setName('Media');
        $gal->setTranslatableLocale('en');
        $manager->persist($gal);
        $manager->flush();
        $this->addReference('media-folder-en', $gal);

        $gal->setTranslatableLocale('nl');
        $manager->refresh($gal);
        $gal->setName('Media');
        $manager->persist($gal);
        $manager->flush();

        $gal->setTranslatableLocale('fr');
        $manager->refresh($gal);
        $gal->setName('Média');
        $manager->persist($gal);
        $manager->flush();

        $subgal = new Folder();
        $subgal->setParent($gal);
        $subgal->setRel(Folder::TYPE_IMAGE);
        $subgal->setName('Images');
        $subgal->setTranslatableLocale('en');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('images-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Afbeeldingen');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Images');
        $manager->persist($subgal);
        $manager->flush();

        $subgal = new Folder();
        $subgal->setParent($gal);
        $subgal->setRel(Folder::TYPE_FILES);
        $subgal->setName('Files');
        $subgal->setTranslatableLocale('en');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('files-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Bestanden');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Fichiers');
        $manager->persist($subgal);
        $manager->flush();

        $subgal = new Folder();
        $subgal->setParent($gal);
        $subgal->setRel(Folder::TYPE_SLIDESHOW);
        $subgal->setName('Slides');
        $subgal->setTranslatableLocale('en');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('slides-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Presentaties');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Presentations');
        $manager->persist($subgal);
        $manager->flush();

        $subgal = new Folder();
        $subgal->setParent($gal);
        $subgal->setRel(Folder::TYPE_VIDEO);
        $subgal->setName('Videos');
        $subgal->setTranslatableLocale('en');
        $manager->persist($subgal);
        $manager->flush();
        $this->addReference('videos-folder-en', $subgal);

        $subgal->setTranslatableLocale('nl');
        $manager->refresh($subgal);
        $subgal->setName('Video\'s');
        $manager->persist($subgal);
        $manager->flush();

        $subgal->setTranslatableLocale('fr');
        $manager->refresh($subgal);
        $subgal->setName('Vidéos');
        $manager->persist($subgal);
        $manager->flush();
    }
975156
public function load(ObjectManager $manager)
    {
        $settingsClass = $this->container->getParameter('blog_settings_class');

        $commentsSwitch = new $settingsClass();
        $commentsSwitch
            ->setProperty('comments_enabled')
            ->setValue(BlogSettings::COMMENTS_ENABLED);
        $manager->persist($commentsSwitch);

        $commentsPublicAccess = new $settingsClass();
        $commentsPublicAccess
            ->setProperty('comments_visible_public')
            ->setValue(BlogSettings::COMMENTS_PUBLIC_VISIBLE);

        $manager->persist($commentsPublicAccess);

        $commenterAccessLevel = new $settingsClass();
        $commenterAccessLevel
            ->setProperty('commenter_access_level')
            ->setValue(BlogSettings::COMMENTER_ACCESS_LEVEL_PUBLIC);

        $manager->persist($commenterAccessLevel);

        $manager->flush();
    }
191761
protected function createDefaultArgs(Manager $manager)
    {
        if (!$this->queryFilter->exists()) {
            return [];
        }
        return [
            self::FILTER => [
                'type' => $manager->getType($this->inputTypeName(self::FILTER)),
            ],
            self::EXCLUDE => [
                'type' => $manager->getType($this->inputTypeName(self::EXCLUDE)),
            ],
        ];
    }
1127575
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $categoryDirector
         */
        $categoryDirector = $this->getDirector('category');

        /**
         * Category.
         *
         * @var CategoryInterface $rootCategory
         */
        $rootCategory = $categoryDirector
            ->create()
            ->setName('root-category')
            ->setSlug('root-category')
            ->setEnabled(true)
            ->setRoot(true);

        $categoryDirector->save($rootCategory);
        $this->addReference('rootCategory', $rootCategory);

        /**
         * Category.
         *
         * @var CategoryInterface $category
         */
        $category = $categoryDirector
            ->create()
            ->setName('category')
            ->setSlug('category')
            ->setEnabled(true)
            ->setParent($rootCategory)
            ->setRoot(false);

        $categoryDirector->save($category);
        $this->addReference('category', $category);

        /**
         * Second level category.
         *
         * @var CategoryInterface $secondLevelCategory
         */
        $secondLevelCategory = $categoryDirector
            ->create()
            ->setName('Second level category')
            ->setSlug('second-level-category')
            ->setEnabled(true)
            ->setParent($category)
            ->setRoot(false);

        $categoryDirector->save($secondLevelCategory);
        $this->addReference('secondLevelCategory', $secondLevelCategory);
    }
614549
protected function getModuleByModel(Model $model)
    {
        /** @var ModuleManagerInterface $modules */
        $modules = app(ModuleManagerInterface::class);

        return $modules->getByAssociatedClass(get_class($model));
    }
125985
public function load(ObjectManager $manager)
    {
        $role1 = $this->createRole($manager, 'ROLE_PERMISSIONMANAGER');
        $role2 = $this->createRole($manager, 'ROLE_ADMIN');
        $role3 = $this->createRole($manager, 'ROLE_SUPER_ADMIN');
        $role4 = $this->createRole($manager, 'IS_AUTHENTICATED_ANONYMOUSLY');

        $manager->flush();

        $this->addReference(self::REFERENCE_PERMISSIONMANAGER_ROLE, $role1);
        $this->addReference(self::REFERENCE_ADMIN_ROLE, $role2);
        $this->addReference(self::REFERENCE_SUPERADMIN_ROLE, $role3);
        $this->addReference(self::REFERENCE_GUEST_ROLE, $role4);
    }
256474
public function manager(RendererManager $manager, Container $container)
    {
        $this->rendererManager = $manager;

        // Prepare Globals
        $this->prepareGlobals($container, $manager);

        return $manager;
    }
324745
public function load(ObjectManager $manager)
    {
        $group1 = $this->createGroup($manager, 'Administrators', array(
            $this->getReference(RoleFixtures::REFERENCE_PERMISSIONMANAGER_ROLE),
            $this->getReference(RoleFixtures::REFERENCE_ADMIN_ROLE),
        ));

        $group2 = $this->createGroup($manager, 'Guests', array(
            $this->getReference(RoleFixtures::REFERENCE_GUEST_ROLE),
        ));

        $group3 = $this->createGroup($manager, 'Super administrators', array(
            $this->getReference(RoleFixtures::REFERENCE_PERMISSIONMANAGER_ROLE),
            $this->getReference(RoleFixtures::REFERENCE_ADMIN_ROLE),
            $this->getReference(RoleFixtures::REFERENCE_SUPERADMIN_ROLE),
        ));

        $manager->flush();

        $this->addReference(self::REFERENCE_ADMINS_GROUP, $group1);
        $this->addReference(self::REFERENCE_GUESTS_GROUP, $group2);
        $this->addReference(self::REFERENCE_SUPERADMINS_GROUP, $group3);
    }
282637
public function load(ObjectManager $manager)
    {
        /**
         * @var ObjectDirector $menuDirector
         */
        $menuDirector = $this->getDirector('menu');

        /**
         * Admin menu.
         */
        $menuAdmin = $menuDirector
            ->create()
            ->setCode('menu-admin')
            ->setEnabled(true)
            ->addSubnode($this->getReference('menu-node-vogue'));

        $menuDirector->save($menuAdmin);
        $this->addReference('menu-admin', $menuAdmin);

        /**
         * Front menu.
         */
        $menuFront = $menuDirector
            ->create()
            ->setCode('menu-front')
            ->setEnabled(true)
            ->addSubnode($this->getReference('menu-node-him'))
            ->addSubnode($this->getReference('menu-node-her'));

        $menuDirector->save($menuFront);
        $this->addReference('menu-front', $menuFront);
    }
492156
public function load(ObjectManager $manager)
    {
        $loader = new Loader();
        $loader->addFile(__DIR__.'/../../Resources/config/data/Metas.yml');
        $loader->load($manager, null, $this);
    }
979697
public function getIdentifierReference($manager)
    {
        if (!isset($this->identifierReferences[$manager])) {
            $rule = new \stdClass();
            $rule->referenceField = $this->identifierField;
            $rule->field          = $this->identifierField;

            return $rule;
        }

        return $this->identifierReferences[$manager];
    }
1221013
protected function getPdo(Manager $manager, $environment): PDO
    {
        /* @var AdapterWrapper $dbAdapter */
        $dbAdapter = $manager->getEnvironment($environment)->getAdapter();

        if ($dbAdapter instanceof PdoAdapter) {
            $pdo = $dbAdapter->getConnection();
        } elseif ($dbAdapter instanceof AdapterWrapper) {
            $dbAdapter->connect();
            $pdo = $dbAdapter->getAdapter()->getConnection();
        } else {
            throw new RuntimeException('Adapter not found');
        }
        if (empty($pdo)) {
            $pdo = $dbAdapter->getOption('connection');
        }
        if (!$pdo instanceof PDO) {
            throw new RuntimeException('PDO database connection not found.');
        }

        return $pdo;
    }
600609
public function load(ObjectManager $manager)
    {
        $userRole = new Role();
        $userRole->setRoleId('user');

        $manager->persist($userRole);
        $manager->flush();

        $adminRole = new Role();
        $adminRole->setRoleId('admin');
        $adminRole->setParent($userRole);

        $manager->persist($adminRole);
        $manager->flush();

        $supervisorRole = new Role();
        $supervisorRole->setRoleId('supervisor');
        $supervisorRole->setParent($userRole);

        $manager->persist($supervisorRole);
        $manager->flush();

        $gameManagerRole = new Role();
        $gameManagerRole->setRoleId('game-manager');
        $gameManagerRole->setParent($supervisorRole);

        $manager->persist($gameManagerRole);
        $manager->flush();

        // store reference to admin role for User relation to Role
        $this->addReference('admin-role', $adminRole);
        $this->addReference('supervisor-role', $supervisorRole);
        $this->addReference('game-role', $gameManagerRole);
    }
982437
protected function decorateManager(array $settings = [], EntityManagerInterface $manager)
    {
        if ($decorator = Arr::get($settings, 'decorator', false)) {
            if (!class_exists($decorator)) {
                throw new InvalidArgumentException("EntityManagerDecorator {$decorator} does not exist");
            }

            $manager = new $decorator($manager);
        }

        return $manager;
    }
874050
public function handle(Manager $manager) {
		$extensions = $manager->getAvailableExtensions()->map(function(ExtensionContract $extension) {
			$mapped = array_intersect_key($extension->toArray(), array_flip(static::$columns));

            $mapped['required']  = $mapped['required'] ? 'Yes' : 'No';
			$mapped['installed'] = $mapped['installed'] ? 'Yes' : 'No';
            $mapped['activated'] = $mapped['activated'] ? 'Yes' : 'No';

            return $mapped;
		});

        $this->table(static::$columns, $extensions->toArray());
	}
106184
protected function createArgs(Manager $manager)
    {
        $args = $this->createDefaultArgs($manager);
        foreach ($this->args as $scaffolder) {
            $args[$scaffolder->argName] = $scaffolder->toArray($manager);
        }
        $this->extend('updateArgs', $args, $manager);
        return $args;
    }