Use a generated Input type, and require an ID.

@param Manager $manager
@return array
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)),
            ],
        ];
    }
173656
protected function loadManager(InputInterface $input, OutputInterface $output)
    {
        if ($this->getManager() === null) {
            $manager = new Manager($this->getConfig(), $input, $output);
            $this->setManager($manager);
        } else {
            $manager = $this->getManager();
            $manager->setInput($input);
            $manager->setOutput($output);
        }
    }
1221668
public function load(ObjectManager $manager)
    {
        $testClient = new ApiClient();
        $testClient->setName('Test client');
        $testClient->setKey('test_key');
        $testClient->setSecret('test_secret');
        $testClient->setTrusted(true);

        $manager->persist($testClient);
        $manager->flush();
    }
417227
public function load(ObjectManager $manager)
    {
        foreach (['de' => 'German', 'fr' => 'French'] as $id => $name) {
            $lang = new Language;
            $lang->setId($id);
            $lang->setName(Translatable::createFromOriginalString($name));
            $manager->persist($lang);
        }

        $manager->flush();
    }
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);
    }
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;
    }
1143421
protected function registerFixedTypes(Manager $manager)
    {
        $fixedTypes = Config::inst()->get(self::class, 'fixed_types');
        if ($fixedTypes) {
            if (!is_array($fixedTypes)) {
                throw new Exception(
                    sprintf(
                        '%s.fixed_types must be an array',
                        __CLASS__
                    )
                );
            }
            foreach ($fixedTypes as $className) {
                $instance = Injector::inst()->get($className);
                if (!$instance instanceof ViewableData) {
                    throw new Exception(
                        sprintf(
                            'Cannot auto register class %s. It is not a subclass of %s',
                            $className,
                            ViewableData::class
                        )
                    );
                }
                if (!$instance->hasExtension(TypeCreatorExtension::class)) {
                    throw new Exception(
                        sprintf(
                            'Cannot auto register class %s. Is does not have the extension %s.',
                            $className,
                            TypeCreatorExtension::class
                        )
                    );
                }
                $instance->addToManager($manager);
            }
        }
    }
1130039
public function searchManager()
    {
        if ($this->_manager === null) {
            $this->_manager = new Manager(
                $this->_repository(),
                $this->_collectionClass
            );
        }

        return $this->_manager;
    }
335668
private function buildForManager(Manager $manager, $destroy)
    {
        $name = $manager->getName();
        if (!$manager->indexExists()) {
            $this->output->writeln(sprintf('Create index for "<comment>%s</comment>" manager.', $name));
            $manager->createIndex();

            return;
        }

        if (!$destroy) {
            return;
        }

        $this->output->writeln(sprintf('Drop and create index for "<comment>%s</comment>" manager.', $name));
        $manager->dropAndCreateIndex();
    }
446652
public function load(ObjectManager $manager)
    {
        $enTag = new Language;
        $enTag->setId('en');
        $enTag->setName(Translatable::createFromOriginalString('English'));

        $manager->persist($enTag);
        $manager->flush();
    }
1114698
protected function _defaultInput($param)
    {
        $input = $param->formInputConfig();
        $name = $param->config('name');
        $input += [
            'type' => 'text',
            'required' => false,
            'label' => Inflector::humanize(preg_replace('/_id$/', '', $name)),
        ];
        if (!$param->visible()) {
            $input['type'] = 'hidden';
        }

        return $input;
    }
666071
public function load(ObjectManager $manager)
    {
        $translator = $this->container->get('translator');
        $infoName = $translator->trans('informations', array(), 'platform');

        $desktopHomeTab = new HomeTab();
        $desktopHomeTab->setType('admin_desktop');
        $desktopHomeTab->setName($infoName);
        $manager->persist($desktopHomeTab);

        $desktopHomeTabConfig = new HomeTabConfig();
        $desktopHomeTabConfig->setHomeTab($desktopHomeTab);
        $desktopHomeTabConfig->setType('admin_desktop');
        $desktopHomeTabConfig->setVisible(true);
        $desktopHomeTabConfig->setLocked(false);
        $desktopHomeTabConfig->setTabOrder(1);
        $manager->persist($desktopHomeTabConfig);

        $workspaceHomeTab = new HomeTab();
        $workspaceHomeTab->setType('admin_workspace');
        $workspaceHomeTab->setName($infoName);
        $manager->persist($workspaceHomeTab);

        $workspaceHomeTabConfig = new HomeTabConfig();
        $workspaceHomeTabConfig->setHomeTab($workspaceHomeTab);
        $workspaceHomeTabConfig->setType('admin_workspace');
        $workspaceHomeTabConfig->setVisible(true);
        $workspaceHomeTabConfig->setLocked(false);
        $workspaceHomeTabConfig->setTabOrder(1);
        $manager->persist($workspaceHomeTabConfig);
    }
1117596
protected function getType(Manager $manager)
    {
        // If an explicit type name has been provided, use it.
        $typeName = $this->getTypeName();
        if ($typeName && $manager->hasType($typeName)) {
            return $manager->getType($typeName);
        }

        // Fall back on a computed type name
        $dataObjectClass = $this->getDataObjectClass();
        if ($dataObjectClass) {
            return StaticSchema::inst()->fetchFromManager(
                $this->getDataObjectClass(),
                $manager,
                StaticSchema::PREFER_SINGLE
            );
        }

        throw new InvalidArgumentException(sprintf(
            '%s must have either a typeName or dataObjectClass member defined.',
            __CLASS__
        ));
    }
1258834
private function _setAnnotationManager(AnnotationManager $manager)
	{
		foreach ( $this->annotationRegistry as $annotation_name => $annotation_class ) {
			$manager->registry[$annotation_name] = $annotation_class;
		}

		$this->annotationManager = $manager;

		return $this;
	}
862802
protected function getPdo(Manager $manager, $environment)
    {
        /* @var AdapterWrapper $dbAdapter */
        $dbAdapter = $manager->getEnvironment($environment)->getAdapter();

        if ($dbAdapter instanceof PdoAdapter) {
            $pdo = $dbAdapter->getConnection();
        } else {
            $dbAdapter->connect();
            $pdo = $dbAdapter->getAdapter()->getConnection();
        }
        if (!$pdo) {
            $pdo = $dbAdapter->getOption('connection');
        }
        if (!$pdo instanceof PDO) {
            throw new Exception('No PDO database connection found.');
        }

        return $pdo;
    }
27309
public function flag($manager, $flag)
    {
        if (!in_array($flag, array(self::FLAG_AVAILABLE, self::FLAG_UNAVAILABLE))) {
            throw new \InvalidArgumentException(
                'Client::flagManager $flag argument must be one of the FLAG_ constants');
        }

        if (!isset($this->managerStatus[$flag][$manager])) {
            $this->managerStatus[$flag][$manager] = $manager;
        }

        $removeFlag = ($flag != self::FLAG_AVAILABLE) ? self::FLAG_AVAILABLE : self::FLAG_UNAVAILABLE;
        if (isset($this->managerStatus[$removeFlag][$manager])) {
            unset($this->managerStatus[$removeFlag][$manager]);
        }
    }
741745
public function load(ObjectManager $manager)
    {
        $user = new User();
        $user->setFirstname('admin');
        $user->setFirstname('admin');
        $user->setUsername('admin');
        $user->setEmail('admin@test.com');
        $user->setState(1);

        $newPass = 'playground';

        $bcrypt = new Bcrypt;
        $bcrypt->setCost(14);

        $pass = $bcrypt->create($newPass);
        $user->setPassword($pass);

        $user->addRole(
            $this->getReference('admin-role') // load the stored reference
        );

        $manager->persist($user);

        $manager->flush();

        $user = new User();
        $user->setFirstname('supervisor');
        $user->setFirstname('supervisor');
        $user->setUsername('supervisor');
        $user->setEmail('supervisor@test.com');
        $user->setState(1);

        $newPass = 'playground';

        $bcrypt = new Bcrypt;
        $bcrypt->setCost(14);

        $pass = $bcrypt->create($newPass);
        $user->setPassword($pass);

        $user->addRole(
            $this->getReference('supervisor-role') // load the stored reference
        );

        $manager->persist($user);

        $manager->flush();

        $user = new User();
        $user->setFirstname('game-manager');
        $user->setFirstname('game-manager');
        $user->setUsername('gamemanager');
        $user->setEmail('game-manager@test.com');
        $user->setState(1);

        $newPass = 'playground';

        $bcrypt = new Bcrypt;
        $bcrypt->setCost(14);

        $pass = $bcrypt->create($newPass);
        $user->setPassword($pass);

        $user->addRole(
            $this->getReference('game-role') // load the stored reference
        );

        $manager->persist($user);

        $manager->flush();
    }