You are here

private function ClassMetadataFactory::getClass in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/serializer/Mapping/Factory/ClassMetadataFactory.php \Symfony\Component\Serializer\Mapping\Factory\ClassMetadataFactory::getClass()

Gets a class name for a given class or instance.

Parameters

mixed $value:

Return value

string|bool

2 calls to ClassMetadataFactory::getClass()
ClassMetadataFactory::getMetadataFor in vendor/symfony/serializer/Mapping/Factory/ClassMetadataFactory.php
If the method was called with the same class name (or an object of that class) before, the same metadata instance is returned.
ClassMetadataFactory::hasMetadataFor in vendor/symfony/serializer/Mapping/Factory/ClassMetadataFactory.php
Checks if class has metadata.

File

vendor/symfony/serializer/Mapping/Factory/ClassMetadataFactory.php, line 110

Class

ClassMetadataFactory
Returns a {@link ClassMetadata}.

Namespace

Symfony\Component\Serializer\Mapping\Factory

Code

private function getClass($value) {
  if (!is_object($value) && !is_string($value)) {
    return false;
  }
  return ltrim(is_object($value) ? get_class($value) : $value, '\\');
}