@param string $resourceClass

@throws \LogicException

@return FamilyInterface
548753
public function getFamily(string $resourceClass): FamilyInterface
    {
        $matchingFamilies = $this->getFamilies($resourceClass);

        if (1 === \count($matchingFamilies)) {
            return reset($matchingFamilies);
        }

        throw new \LogicException("Cannot resolve family for class '{$resourceClass}'");
    }
747586
public static function fromResourceObject(ResourceObject $resourceObject) {
		$resourceIdentifierObject = new self($resourceObject->type, $resourceObject->id);
		
		if ($resourceObject->meta !== null) {
			$resourceIdentifierObject->setMetaObject($resourceObject->meta);
		}
		
		return $resourceIdentifierObject;
	}
955819
protected function createResourceRepository(
        $class,
        EntityManagerInterface $entityManager,
        ClassMetadata $metadata,
        ResourceInterface $resource = null
    ) {
        if ($resource !== null && is_a($class, BaseRepositoryInterface::class, true)) {
            return new $class($entityManager, $metadata, $resource);
        }

        return new $class($entityManager, $metadata);
    }
1281579
public function set(ResourceInterface $resource): ResourceCollectionInterface
    {
        if (!$this->isEmpty()) {
            throw new \LogicException('Tried to add a second resource to single resource collection...');
        }

        return parent::set($resource);
    }
236406
public function entity(string $entityClass) : EntityMapperDefiner
    {
        return new EntityMapperDefiner($this->iocContainer, function (callable $entityMapperFactory) use ($entityClass) {
            $this->entityMapperFactories[] = $entityMapperFactory;
        });
    }
838305
private function deserializeMessage($serializedMessage, $messageClass)
    {
        $message = $this->objectSerializer->deserialize($serializedMessage, $messageClass);

        if (!($message instanceof $messageClass)) {
            throw new \LogicException(
                sprintf(
                    'Expected deserialized message to be an instance of "%s"',
                    $messageClass
                )
            );
        }

        return $message;
    }
1291875
public function getCollection(string $resourceClass, string $operationName = null)
    {
        if (!is_a($resourceClass, FamilyInterface::class, true)) {
            throw new ResourceClassNotSupportedException();
        }

        return $this->familyRegistry->getFamilies();
    }
892043
private function getResource(string $resourceClass): AbstractResource
    {
        return new $resourceClass(
            $this->client,
            $this->responseTransformer,
            $this->apiExceptionTransformer,
            $this->accessToken
        );
    }
923038
public function getService($serviceClass)
    {
        $dfpServices = new DfpServices();

        $session = $this->session();

        return $dfpServices->get($session, $serviceClass);
    }
218746
private function createDataMapper($entityClass)
    {
        /** @var DataMapperInterface $dataMapper */
        $dataMapperClass = isset($this->config['dataMapper']) ? $this->config['dataMapper'] : DoctrineDataMapper::class;

        $meta = $this->builder->getMeta($entityClass);

        if ($meta->storage['type'] == 'api') {
            $dataMapperClass = $meta->storage['handler'];
        }

        switch ($dataMapperClass) {
            case CsvDataMapper::class:
                $connectionClass = CsvDataGateway::class;

                break;

            default:
                $connectionClass = Connection::class;

                break;
        }

        $dataMapper = new $dataMapperClass(
            $this->getConnection($connectionClass),
            $entityClass,
            $meta->storage['table'],
            $this->entityRegistry
        );

        if ($dataMapper instanceof DispatcherAwareInterface) {
            $dataMapper->setDispatcher($this->getDispatcher());
        }

        return $dataMapper;
    }
1274846
public function relatedCollection($resourceModel, RelatedRepository $repository)
    {
        if ($repository instanceof ConditionAwareRepository) {
            $this->applyFilters($this->filters, $this->filterFactory, $repository);
        }

        if ($repository instanceof OneToOneRelationRepository) {
            return $repository->getOne($resourceModel);
        }

        if ($repository instanceof OneToManyRelationRepository) {
            return $repository->getMany($resourceModel);
        }

        throw new \InvalidArgumentException('Repository ' . get_class($repository) . ' has no relation repository interface defined.');
    }
423347
private function resolveResource($class)
    {
        if (array_key_exists($class, $this->cache)) {
            return $this->cache[$class];
        }

        $found = null;

        foreach ($this->resourceRegistry as $resource) {
            if ($resource->getModel() === $class) {
                $found = $resource;

                break;
            }
        }

        return $this->cache[$class] = $found;
    }
1321819
public function createResizedImageVersions($imageurl, $imageclass)
    {
        if (!$this->resizer instanceof ImageResizer) {
            throw new \LogicException('no ImageResizer available, set it using ResponsiveImageHelper::setResizer()');
        }
        $image = $this->getResponsiveImage($imageurl, $imageclass);
        $image->createResizedVersions($this->resizer);
    }
1199155
protected function buildClassName($class, $extends = '', $implements = '')
    {
        $classname = $this->namespace . '\\' . $class;
        if (! class_exists($classname)) {
            throw new \LogicException("Class $classname does not exists");
        }
        if ('' !== $extends) {
            if (! in_array($extends, class_parents($classname))) {
                throw new \LogicException("Class $classname does not extends $extends");
            }
        }
        if ('' !== $implements) {
            if (! in_array($implements, class_implements($classname))) {
                throw new \LogicException("Class $classname does not implements $implements");
            }
        }
        return $classname;
    }
1123253
public function setEntityClass($entityClass)
    {
        if (!is_string($entityClass)) {
            throw new \InvalidArgumentException('The attribute entityClass on the class Project has to be string (' . gettype($entityClass) . ('object' === gettype($entityClass) ? ' ' . get_class($entityClass) : '') . ' given).');
        }

        $this->entityClass = $entityClass;

        return $this;
    }
1011074
public function setDependencyResolver(DependencyResolver $dependencyResolver)
    {
        if ($this->dependencyResolver != null) {
            throw new \LogicException('There is an instance of DependencyManager class in class ContentManager.');
        }

        $this->dependencyResolver = $dependencyResolver;
    }
276488
public function build(string $class = Address::class): Address
    {
        if (!is_a($class, Address::class, true)) {
            throw new LogicException('First parameter to LocationBuilder::build must be a class name extending Geocoder\Model\Address');
        }

        $country = null;
        if (!empty($this->country) || !empty($this->countryCode)) {
            $country = new Country($this->country, $this->countryCode);
        }

        return new $class(
            $this->providedBy,
            new AdminLevelCollection($this->adminLevels),
            $this->coordinates,
            $this->bounds,
            $this->streetNumber,
            $this->streetName,
            $this->postalCode,
            $this->locality,
            $this->subLocality,
            $country,
            $this->timezone
        );
    }