Returns the COID itself if it is a root COID or a new IRI object
representing the namespace underlying the given COID.

@param IRI $coid
@return IRI|null
13965
public static function getNamespaceCOID(IRI $coid) {
    switch (self::getType($coid)) {
      case self::COID_ROOT:
        return $coid;
      case self::COID_UNVERSIONED:
      case self::COID_VERSIONED:
      case self::COID_VERSION_WILDCARD:
        return new IRI('coid://'.$coid->getHost());
      default:
        return null;
    }
  }
1182539
public function getPluginWrapper($instanceId)
    {
        if ($this->pluginWrappers->count() < 1) {
            return null;
        }

        /** @var PluginWrapper $pluginWrapper */
        foreach ($this->pluginWrappers as $pluginWrapper) {
            if ($pluginWrapper->getInstance()->getInstanceId() == $instanceId) {
                return $pluginWrapper;
            }
        }

        return null;
    }
928107
public function tree($rootId = NULL){
        if($rootId === NULL){
            $rootId = '__root';
        }

        if(!isset($this->_rootNodeCache[$rootId])){

            $result = $this->getHierarchyByRootIdQuery($rootId)
                           ->get($this->getSelectColumns());

            $this->fillNodeCache($result);

            Helper::toHierarchy($result);

        }

        return $this->_rootNodeCache[$rootId];
    }
1166106
public function getClass(string $oid)
    {
        // if OID is provided by this factory
        if (array_key_exists($oid, self::MAP_OID_TO_CLASS)) {
            return self::MAP_OID_TO_CLASS[$oid];
        }
        // try additional providers
        foreach ($this->_additionalProviders as $provider) {
            if ($provider->supportsOID($oid)) {
                return $provider->getClassByOID($oid);
            }
        }
        return null;
    }
248160
public function getParent(string $id = null)
    {
        if (!$this->_parents || ($id !== null && !isset($this->_parents[$id]))) {
            return null;
        }

        return $id !== null ?
            $this->_parents[$id] :
            $this->_parents[array_rand($this->_parents)];
    }
736887
public function tree($id = null)
    {
        $id = ($id == null) ? $this->root : $id;
        return $this->stack[$id];
    }
1052134
public function champion($championId)
	{
		if ( ! isset($this->info['champions'][$championId]))
		{
			return null;
		}

		return $this->info['champions'][$championId];
	}
1312428
protected function getRootId()
	{
		$manager = \Aimeos\MShop::create( $this->getContext(), 'catalog' );

		try {
			return $manager->getTree( null, [], \Aimeos\MW\Tree\Manager\Base::LEVEL_ONE )->getId();
		} catch( \Exception $e ) {
			return null;
		}
	}
30734
protected function getUser4Id($userId): ?UserInterface
    {
        /** @var \PServerCore\Entity\Repository\User $userRepository */
        $userRepository = $this->entityManager->getRepository($this->entityOptions->getUser());

        return $userRepository->getUser4Id($userId);
    }
559050
public function getResource($resourceId)
    {
        if (isset($this->resources[$resourceId])) {
            return $this->resources[$resourceId];
        }

        $dynamicResource = $this->dynamicResourceMapper($resourceId);

        if (!empty($dynamicResource)) {
            return $dynamicResource;
        }

        return null;
    }
1010196
public function find($id)
    {
        foreach ($this->findAll() as $repo) {
            if ($id == $repo->getId()) {
                return $repo;
            }
        }

        return null;
    }
56938
public function getSiteByRootPageId($rootPageId)
    {
        $cacheId = 'SiteRepository' . '_' . 'getSiteByPageId' . '_' . $rootPageId;

        $methodResult = $this->runtimeCache->get($cacheId);
        if (!empty($methodResult)) {
            return $methodResult;
        }

        $methodResult = $this->buildSite($rootPageId);
        $this->runtimeCache->set($cacheId, $methodResult);

        return $methodResult;
    }
1169872
public static function getBundle(string $bundleId)
    {
        if (!array_key_exists($bundleId, self::$runtimeBundles)) {
            return null;
        }
        
        $bundle = &self::$runtimeBundles[$bundleId];
        $bundle->link = Request::getLocationUrl(Output::DEFAULT_BUNDLE_PATH_PREFIX . '/' . $bundleId);
        if (empty($bundle->directory)) {
            $bundle->directory = Xentriq::getActiveContentDirectory();
        }
        
        return $bundle;
    }
910074
public static function getDomain($uri)
    {
        $returnValue = parse_url($uri, PHP_URL_HOST);
        if (empty($returnValue)) {
            return null;
        }

        return $returnValue;
    }
918805
protected function getPropertyQueryName($propertyId)
    {
        $propertyDefinition = $this->getObjectType()->getPropertyDefinition($propertyId);
        if ($propertyDefinition === null) {
            return null;
        }

        return $propertyDefinition->getQueryName();
    }
831647
public function findOneById($seoId)
    {
        $qb = $this->createQueryBuilder('s');
        $query = $qb
            ->andWhere($qb->expr()->eq('s.id', $seoId))
            ->setMaxResults(1)
            ->getQuery()
            //->useResultCache(true, 3600, 'ekyna_cms.seo[id:'.$seoId.']') // TODO doctrine cache clear/update
        ;
        return $query->getOneOrNullResult();
    }
993144
protected function getCache($documentId)
    {
        if (isset($this->cache[$documentId])) {
            return $this->cache[$documentId];
        }

        return null;
    }