@param string $class

@return NormalizationObjectMappingInterface

@throws SerializerLogicException
163988
public function getObjectMapping(string $class): NormalizationObjectMappingInterface
    {
        $reflectionClass = new \ReflectionClass($class);

        if (in_array('Doctrine\Common\Persistence\Proxy', $reflectionClass->getInterfaceNames(), true)) {
            $class = $reflectionClass->getParentClass()->name;
        }

        if (isset($this->objectMappings[$class])) {
            return $this->objectMappings[$class];
        }

        throw SerializerLogicException::createMissingMapping($class);
    }
556474
private function initializeMethodNamesMap($class)
    {
        $this->serviceIdToMethodNameMap = array();
        $this->usedMethodNames = array();

        if ($reflectionClass = $this->container->getReflectionClass($class)) {
            foreach ($reflectionClass->getMethods() as $method) {
                $this->usedMethodNames[strtolower($method->getName())] = true;
            }
        }
    }
1339817
public function deepClone($class = null)
    {
        $class = (is_null($class)) ? static::class : $class;
        /** @var $obj Query */
        $obj = new $class($this->model);
        $obj->aliasRefCount = $this->aliasRefCount;
        $obj->useDefaultCols = $this->useDefaultCols;
        $obj->tableAlias = $this->tableAlias;
        $obj->tableJoinsMap = $this->tableJoinsMap;
        $obj->tablesAliasList = $this->tablesAliasList;
        $obj->select = $this->select;
        $obj->groupBy = $this->groupBy;
        $obj->valueSelect = $this->valueSelect;
        $obj->selectRelected = $this->selectRelected;
        $obj->standardOrdering = $this->standardOrdering;
        $obj->annotations = $this->annotations;
        $obj->defaultOrdering = $this->defaultOrdering;
        $obj->orderBy = $this->orderBy;
        $obj->offset = $this->offset;
        $obj->limit = $this->limit;
        $obj->where = $this->where->deepClone();

        return $obj;
    }
638116
protected function denormalizeObject($data, $class, $format, array $context)
    {
        if (!$this->serializer instanceof DenormalizerInterface) {
            throw new LogicException(
                'Cannot denormalize object because the injected serializer is not a denormalizer'
            );
        }

        return $this->serializer->denormalize($data, $class, $format, $context);
    }
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;
    }
134412
public function getSpecificSubclassMapping(string $class): self
    {
        if ($this->class->getClassName() === $class) {
            return $this;
        }

        if (!is_subclass_of($class, $this->class->getClassName(), true)) {
            throw InvalidArgumentException::format(
                'Invalid class supplied to %s: must be a subclass of %s, %s given',
                __METHOD__, $this->class->getClassName(), $class
            );
        }

        foreach ($this->subClassMappings as $mapping) {
            if (is_subclass_of($class, $mapping->getDefinition()->getClassName(), true)) {
                return $mapping->getDefinition()->getSpecificSubclassMapping($class);
            }
        }

        throw InvalidArgumentException::format(
            'Invalid class supplied to %s: cannot find mapping for %s',
            __METHOD__, $class
        );
    }
1090301
public function loadMetadataForClass(\ReflectionClass $class)
    {
        $classMetadata                  = new MergeableClassMetadata($name = $class->name);
        $classMetadata->fileResources[] = $class->getFileName();

        foreach ($class->getProperties() as $property) {
            $propertyMetadata = new PropertyMetadata($name, $property->getName());
            $propertyAnnotations = $this->reader->getPropertyAnnotations($property);

            foreach ($propertyAnnotations as $annotation) {
                if ($annotation instanceof Fixture\Data) {
                    $propertyMetadata->staticData = $annotation->value;
                } elseif ($annotation instanceof Fixture\Faker) {
                    $propertyMetadata->fakerName = $annotation->name;
                    $propertyMetadata->fakerResolverType = $annotation->type;
                    $propertyMetadata->fakerResolverArgs = $annotation->arguments;
                } elseif ($annotation instanceof Fixture\Ignore) {
                    $propertyMetadata->ignore = true;
                }
            }

            $classMetadata->addPropertyMetadata($propertyMetadata);
        }

        return $classMetadata;
    }
895784
protected function deserialize($data, string $class)
    {
        // @todo Is this extractor required?
        $dataServiceExtractor = new DataServiceExtractor();
        $dataServiceExtractor->setClass($this->dataService->getClass());
        $dataServiceExtractor->setCustomFields($this->dataService->getCustomFields());

        // The serializer treats the $xmlns as it's own separate property, and
        // there is no way to access it from within the extractor. We can't
        // alter $context in the CJsonEncoder as it is not passed by reference.
        // @todo This feels like a bit of a hack.
        $decoded = \GuzzleHttp\json_decode($data, true);
        if (isset($decoded['$xmlns'])) {
            $dataServiceExtractor->setNamespaceMapping($decoded['$xmlns']);
        }

        $p = new PropertyInfoExtractor([], [$dataServiceExtractor], [], []);
        $cached = new PropertyInfoCacheExtractor($p, $this->cacheItemPool);

        $object = $this->getObjectSerializer($cached)->deserialize($data, $class, 'json');

        // Adds any missing custom field classes. A given object may not
        // contain any set fields in a given custom field namespace. In that
        // case, the serializer will never create a field class. This is fine
        // until calling code wants to check to see if a given field exists.
        // By ensuring we add in any missing custom field definitions, we
        // ensure a valid object is returned instead of null.
        if ($object instanceof ObjectInterface) {
            $customFields = $object->getCustomFields();
            $remaining = array_diff_key($this->dataService->getCustomFields(), $customFields);

            /** @var string $namespace */
            /** @var DiscoveredCustomField $field */
            foreach ($remaining as $namespace => $field) {
                $namespaceClass = $field->getClass();
                $customFields[$namespace] = new $namespaceClass();
            }

            $object->setCustomFields($customFields);
        }

        if ($object instanceof JsonInterface) {
            $object->setJson($data);
        }

        return $object;
    }
1286321
protected function transformResponse(string $class = null)
    {
        if (200 !== $this->getResponse()->getStatusCode()
            && 201 !== $this->getResponse()->getStatusCode()
        ) {
            return $this->handleException();
        }

        if (null === $this->getInstapushClient()->getTransformer() || null === $class) {
            return \json_decode($this->getResponse()->getBody()->getContents(), true);
        }

        return $this->getInstapushClient()->getTransformer()->transform($this->getResponse(), $class);
    }
1118476
protected function setSerializerClass(string $serializerClass): self
    {
        assert(
            class_exists($serializerClass) === true &&
            in_array(JsonApiDataRulesSerializerInterface::class, class_implements($serializerClass)) === true
        );

        $this->serializerClass = $serializerClass;

        return $this;
    }
106862
public function offsetGet($class)
	{
		if (!isset($this->factories[$class]) && !isset($this->instances[$class])) {
			throw new \InvalidArgumentException("$class has not been defined");
		}

		if (isset($this->instances[$class])) {
			return $this->instances[$class];
		}

		array_push($this->resolving, $class);
		$object = $this->invoke($this->factories[$class]);
		array_pop($this->resolving);

		return $object;
	}
491974
public static function createEmbedMany(string $name, string $class): DenormalizationFieldMappingBuilderInterface
    {
        $self = new self($name);
        $self->fieldDenormalizer = new EmbedManyFieldDenormalizer($class, new PropertyAccessor($name));

        return $self;
    }
695675
public function normalize($object)
    {
        if (!is_object($object)) {
            throw new JsonSerializerException("Can only serialize objects.");
        }

        $this->reset();
        return $this->normalizeObject($object);
    }
949825
public function resolveClass(string $class)
    {
        $object = $this->getClass($class);

        $definitions = $this->container->isDefined($object->getName())
            ? $this->container->getDefiniition($object->getName()) : null;

        $constructor_parameters = $object->getConstructor() !== null ? $object->getConstructor()->getParameters() : null;
        $parameters = $this->resolveParameters($constructor_parameters ?? [], $definitions);

        return $object->newInstanceArgs($parameters);
    }
334553
public function load(string $class): HydratorInterface
    {
        if (isset($this->hydrators[$class])) {
            return $this->hydrators[$class];
        }

        /** @var ClassMetadata $classMetadata */
        $classMetadata = $this->metadataFactory->getMetadataForClass($class);

        if (null === $classMetadata) {
            throw new \RuntimeException(
                'No mapping file was found for class '.$class.
                '. Did you configure the correct paths for serializer?'
            );
        }

        $fqn = $this->configuration->getFQNClassName($classMetadata);

        if (\class_exists($fqn, false)) {
            return $this->hydrators[$class] = $this->factory->newInstance($classMetadata);
        }

        $this->compileAndLoad($classMetadata);

        return $this->hydrators[$class] = $this->factory->newInstance($classMetadata);
    }
708711
public function map($name, $class = null)
    {
        if (is_array($name)) {
            foreach ($name as $name => $class) {
                $this->map($name, $class);
            }

            return $this;
        }

        $this->builder->addDiscriminatorMapClass($name, $class);

        return $this;
    }
677051
public static function classAutoLoader(string $class)
    {
        self::ensureDefines();
        
        $coreBaseNamespace = str_replace('\\', '/', __NAMESPACE__) . '/';
        
        $classWithNamespaceToLoad = str_replace('\\', '/', $class);
        $classWithRelativeNamespaceToLoad = str_replace($coreBaseNamespace, '', $classWithNamespaceToLoad);
        
        $namespaceToLoad = dirname($classWithNamespaceToLoad);
        $classToLoad = basename($classWithNamespaceToLoad);
        
        $classFileName = $classToLoad . EXT_PHP;
        
        $paths = array();
        
        $possibleParentConstants = array(
            Xentriq::CONST_DIR_CORE, // core directory
            Xentriq::CONST_DIR_LIBS, // libraries directory
            Xentriq::CONST_DIR_ADDONS, // addon directory
            Xentriq::CONST_DIR_ASSUMED_ROOT // assumed root directory
        );
        
        foreach ($possibleParentConstants as $possibleParentConstant) {
            // search core directory
            if (defined($possibleParentConstant)) {
                $parentPath = constant($possibleParentConstant);
                
                $paths[] = ($parentPath . '/' . $classFileName);
                $paths[] = ($parentPath . $classWithNamespaceToLoad . EXT_PHP);
                $paths[] = ($parentPath . strtolower(dirname($classWithRelativeNamespaceToLoad)) . '/' . $classFileName);
                
                // search paths with hyphen
                $segments = explode('/', $namespaceToLoad);
                
                for ($sidx = 1; $sidx <= (sizeof($segments)); $sidx++) {
                    $baseHyphenPath = implode('-', array_slice($segments, 0, $sidx));
                    $completeHyphenPath = $baseHyphenPath . CHAR_SLASH . implode('/', array_slice($segments, $sidx));
                    
                    $paths[] = ($parentPath . $baseHyphenPath . '/' . $classFileName);
                    $paths[] = ($parentPath . $completeHyphenPath . '/' . $classFileName);
                    $paths[] = ($parentPath . strtolower($baseHyphenPath) . '/' . $classFileName);
                    $paths[] = ($parentPath . strtolower($completeHyphenPath) . '/' . $classFileName);
                }
            }
        }
        
        foreach ($paths as $path) {
            if (is_file($path) && !class_exists($path)) {
                require_once $path;
                
                // exit loader
                return;
            }
        }
        
        // search in addons
        $classFile = Addons::searchAddonClassFile($class);
        if (is_file($classFile)) {
            require_once $classFile;
        }
    }