Получает ключ для кеширования карты сущностей

@param $objectManagerName

@return string
332253
public function getCacheKeyForObjectManagerName($objectManagerName)
    {
        if (array_key_exists($objectManagerName, $this->cacheKeys)) {
            return $this->cacheKeys[$objectManagerName];
        }

        $preffix = $this->getModuleOptions()->getEntityMapDoctrineCachePrefix();
        $key = $preffix . '_' . $objectManagerName;

        $this->cacheKeys[$objectManagerName] = $key;

        return $this->cacheKeys[$objectManagerName];
    }
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();
    }
43314
public function load(ObjectManager $manager)
    {
        if ($this->container->getParameter('kunstmaan_admin.multi_language')) {
            $languages = explode('|', $this->container->getParameter('kunstmaan_admin.required_locales'));
        }
        if (!is_array($languages) || count($languages) < 1) {
            $languages = array('en');
        }

        $em = $this->container->get('doctrine.orm.entity_manager');

        $pageCreator = $this->container->get('kunstmaan_node.page_creator_service');

        // Create article overview page
        $nodeRepo = $em->getRepository('KunstmaanNodeBundle:Node');
        $homePage = $nodeRepo->findOneBy(array('internalName' => 'homepage'));

        $searchPage = new SearchPage();
        $searchPage->setTitle('Search');

        $translations = array();
        foreach ($languages as $lang) {
            if ($lang == 'nl') {
                $title = 'Zoeken';
            } else {
                $title = 'Search';
            }

            $translations[] = array('language' => $lang, 'callback' => function($page, $translation, $seo) use($title) {
                $translation->setTitle($title);
                $translation->setWeight(50);
                $slugifier = $this->container->get('kunstmaan_utilities.slugifier');
                $translation->setSlug($slugifier->slugify($title));
            });
        }

        $options = array(
            'parent' => $homePage,
            'page_internal_name' => 'search',
            'set_online' => true,
            'hidden_from_nav' => true,
            'creator' => 'Admin'
        );

        $pageCreator->createPage($searchPage, $translations, $options);
    }
447673
private function createRole(ObjectManager $manager, $name)
    {
        $role = new Role($name);
        $manager->persist($role);

        return $role;
    }
492209
public static function get_by_object_classname($classname) {
		$db = Database::Get();
		$ids = $db->getCol('SELECT id FROM object_text WHERE classname=?', [ $classname ]);
		$object_texts = [];
		foreach ($ids as $id) {
			$object_texts[] = self::get_by_id($id);
		}
		return $object_texts;
	}
12195
public function getFieldNames($objectName)
    {
        $fieldNames = array();
        $modelConfiguration = $this->getModelConfiguration($objectName);
        if (isset($modelConfiguration['__field_index'])) {
            $fieldNames = array_keys($modelConfiguration['__field_index']);
        }

        return $fieldNames;
    }
1165062
public function buildEntityMapByObjectManagerName($objectManagerName)
    {
        $entityClassNames = $this->getEntityClassNamesByObjectManagerName($objectManagerName);

        $listEntityInterfaces = $this->buildListEntityInterfaces($entityClassNames);

        $map = [];

        $entityManager = $this->getEntityManager();
        foreach ($listEntityInterfaces as $currentInterface) {
            if ($entityManager->hasEntityClassByInterface($currentInterface)) {
                $map[$currentInterface] = $entityManager->getEntityClassByInterface($currentInterface);
            }
        }

        return $map;
    }
325089
public function getFieldsByView($objectName, $viewName)
    {
        $fieldConfigurations = array();

        $viewConfiguration = $this->getViewConfiguration($objectName, $viewName);
        if (is_array($viewConfiguration)) {
            $fieldConfigurations = $viewConfiguration["fields"];
            foreach ($fieldConfigurations as $i => $fieldConfiguration) {
                $fieldConfigurations[$i] = array_replace_recursive($this->defaultFieldConfiguration, $fieldConfiguration);
            }
        }
        usort($fieldConfigurations, array($this, 'sortByLocation'));

        return $fieldConfigurations;
    }
83310
public function getClassNameByObjectName($objectName)
    {
        if (!isset($this->objects[$objectName])) {
            return (class_exists($objectName)) ? $objectName : false;
        }
        return (isset($this->objects[$objectName]['c']) ? $this->objects[$objectName]['c'] : $objectName);
    }
362219
public function getModelConfiguration($objectName)
    {
        if (isset($this->configuration[$objectName])) {
            $modelConfiguration = $this->configuration[$objectName];
            $modelConfiguration['__object_name'] = $objectName;
            if (isset($modelConfiguration['fields']) === false) {
                $modelConfiguration['fields'] = array();
            }

            return $modelConfiguration;
        }
    }
503473
public function hasEntityMap($objectManagerName)
    {
        $key = $this->getCacheKeyForObjectManagerName($objectManagerName);

        return $this->getCache()->contains($key);
    }
1080374
public function GetTableName($objectclass, $propertyname)
	{
		$fm = $this->GetFieldMap($objectclass, $propertyname);
		return $fm->TableName;
	}
1003675
public static function getNodeInterfaceImplementations($objectManager)
    {
        $reflectionService = $objectManager->get(ReflectionService::class);
        $nodeImplementations = $reflectionService->getAllImplementationClassNamesForInterface(NodeInterface::class);
        return $nodeImplementations;
    }
293130
public static function getPolyTypeObjectValidatorImplementationClassNames($objectManager)
    {
        $reflectionService = $objectManager->get(ReflectionService::class);
        $result = $reflectionService->getAllImplementationClassNamesForInterface(Validator\PolyTypeObjectValidatorInterface::class);
        return $result;
    }
205316
public function load(ObjectManager $manager)
    {
        $geocoder = new \HarvestCloud\GeoBundle\Util\GoogleGeocoder();

        $user = new User();
        $user->setEmail('jon.seller@example.com');
        $user->setFirstname('Jon');
        $user->setLastname('Seller');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('seller', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemSellerStatus(Profile::STATUS_ENABLED);
        $profile->setSellerStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('100 Main Street');
        $location->setTown('Lee');
        $location->setStateCode('MA');
        $location->setPostalCode('01238');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('jon-seller', $profile);


        $user = new User();
        $user->setEmail('tom.seller@example.com');
        $user->setFirstname('Tom');
        $user->setLastname('Seller');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('seller', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemSellerStatus(Profile::STATUS_ENABLED);
        $profile->setSellerStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('100 Main Street');
        $location->setTown('Great Barrington');
        $location->setStateCode('MA');
        $location->setPostalCode('01230');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('tom-seller', $profile);


        $user = new User();
        $user->setEmail('stephen.seller@example.com');
        $user->setFirstname('Stephen');
        $user->setLastname('Seller');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('seller', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemSellerStatus(Profile::STATUS_ENABLED);
        $profile->setSellerStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('100 Main Street');
        $location->setTown('Lenox');
        $location->setStateCode('MA');
        $location->setPostalCode('01240');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('stephen-seller', $profile);


        $user = new User();
        $user->setEmail('jo.seller@example.com');
        $user->setFirstname('Jo');
        $user->setLastname('Seller');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('seller', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemSellerStatus(Profile::STATUS_ENABLED);
        $profile->setSellerStatus(Profile::STATUS_ACTIVE);
        $profile->setSlug('joseller');

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('50 Main Street');
        $location->setTown('Lenox');
        $location->setStateCode('MA');
        $location->setPostalCode('01240');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('jo-seller', $profile);


        $user = new User();
        $user->setEmail('mike.seller@example.com');
        $user->setFirstname('Mike');
        $user->setLastname('Seller');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('seller', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemSellerStatus(Profile::STATUS_ENABLED);
        $profile->setSellerStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('1 East Street');
        $location->setTown('Great Barrington');
        $location->setStateCode('MA');
        $location->setPostalCode('01240');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('mike-seller', $profile);


        $user = new User();
        $user->setEmail('sterling.seller@example.com');
        $user->setFirstname('Sterling');
        $user->setLastname('Seller');
        $user->setEnabled(true);

        $encoder = $this->container
            ->get('security.encoder_factory')
            ->getEncoder($user)
        ;

        $user->setPassword($encoder->encodePassword('seller', $user->getSalt()));

        $profile = new Profile();
        $profile->setName($user->getFullname());
        $profile->setSystemSellerStatus(Profile::STATUS_ENABLED);
        $profile->setSellerStatus(Profile::STATUS_ACTIVE);

        $user->addProfile($profile);

        $location = new Location();
        $location->setName('Default');
        $location->setAddressLine1('1 East Street');
        $location->setTown('Lee');
        $location->setStateCode('MA');
        $location->setPostalCode('01238');

        $geocoder->geocode($location);

        $profile->addLocation($location);

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

        $this->addReference('sterling-seller', $profile);
    }
1120385
protected function getObjectManagerName(MetadataInterface $metadata): ?string
    {
        $objectManagerName = null;

        if ($metadata->hasParameter('options') && isset($metadata->getParameter('options')['object_manager'])) {
            $objectManagerName = $metadata->getParameter('options')['object_manager'];
        }

        return $objectManagerName;
    }
718887
public static function getActionMethodParameters($objectManager)
    {
        $reflectionService = $objectManager->get(ReflectionService::class);

        $result = [];

        $className = get_called_class();
        $methodNames = get_class_methods($className);
        foreach ($methodNames as $methodName) {
            if (strlen($methodName) > 6 && strpos($methodName, 'Action', strlen($methodName) - 6) !== false) {
                $result[$methodName] = $reflectionService->getMethodParameters($className, $methodName);
            }
        }

        return $result;
    }