returns the name of an object

@param $object
@return null|string
@throws \ReflectionException
961052
public static function getClassName($object): ?string {
        $validObject = ClassUtil::isValidObject($object);
        if (!$validObject) {
            return null;
        }
        return (new \ReflectionClass($object))->getName();
    }
1185101
public static function getClassAnnotations($object)
	{
		$classReflection = new \ReflectionClass($object);
		$docBlock = $classReflection->getDocComment();
		$lines = explode("\n", $docBlock);
		$annotations = array();
		foreach ($lines as $line)
		{
			if (preg_match('~^(((\s*\*)|/\*\*)\s*@)(?<annotationName>[^\s]+)\s+(?<annotationValue>.*)~', $line, $matches))
			{
				$annotations[$matches['annotationName']][] = $matches['annotationValue'];
			}
		}
		return $annotations;
	}
1363054
public static function getFirstId($object)
    {
        $tableAnnotation = static::getAnnotation($object, Table::class);
        if(null !== $tableAnnotation)
        {
            if(is_array($tableAnnotation->id))
            {
                return reset($tableAnnotation->id);
            }
            else
            {
                return $tableAnnotation->id;
            }
        }
        else
        {
            return null;
        }
    }
389946
protected function getObjectDisplay($object = null)
    {
        if (!$object || !$object->isInDB()) {
            return '';
        }

        // Use image tag
        // TODO Use CMSThumbnail instead to limit max size, blocked by DataDifferencerTest and GC
        // not playing nice with mocked images
        if ($object instanceof Image) {
            return $object->getTag();
        }

        // Format title
        return $object->obj('Title')->forTemplate();
    }
93551
protected function getPrefix($object)
    {
        $id = 'user';

        if (method_exists($object, 'getOrganization')) {
            $org = $object->getOrganization();

            if ($org instanceof OrganizationInterface) {
                $id = (string) $org->getId();
            }
        }

        return $id.'__';
    }
1142315
public static function objectToID($object)
    {
        $resultID = null;
        if (is_object($object) && method_exists($object, '__toString')
        ) {
            $resultID = $object->__toString();
        } else {
            if (is_array($object)) {
                foreach ($object as $item => $value) {
                    $resultID[$item] = self::objectToID($value);
                }
            } else { //String
                $resultID = $object;
            }
        }

        return $resultID;
    }
1220251
protected function getId(&$object)
    {
        if (is_array($object)) {
            if (isset($object['_id']) && $object['_id']) {
                return $object['_id'];
            }

            return $object['_id'] = new ObjectId();
        }

        if (is_object($object) && !$object instanceof ObjectId) {
            if (isset($object->_id) && $object->_id) {
                return $object->_id;
            }

            return $object->_id = new ObjectId();
        }

        return $object;
    }
652016
public function getMappedObjectType($object): ?string
    {
        foreach ($this->typesMapping as $type => $typeClass) {
            if (is_a($object, $typeClass)) {
                return $type;
            }
        }

        return null;
    }
497554
public function getGettablePropertiesOfObject($object)
    {
        $className = get_class($object);

        if (false === isset($this->gettablePropertiesOfObjects[$className])) {
            $this->gettablePropertiesOfObjects[$className] = [];
            $properties = $this->getReflectionService()->getClassPropertyNames($className);

            foreach ($properties as $propertyName) {
                if (true === $this->isPropertyGettable($object, $propertyName)) {
                    $this->gettablePropertiesOfObjects[$className][] = $propertyName;
                }
            }
        }

        return $this->gettablePropertiesOfObjects[$className];
    }
1240668
public function getObjectValue($object, $name)
    {
        if (is_object($object) && isset($object->$name) && !method_exists($object, $name)) {
            return $object->$name;
        }

        // If its a nested value like meta[user[phone]]
        if (strpos($name, '[') > 0) {
            $nested = explode('[', str_replace(']', '', $name));
            $final = $object;
            foreach ($nested as $property) {
                if (!empty($property) && isset($final->{$property})) {
                    $final = $final->{$property};
                } elseif (is_object($final) && is_null($final->{$property})) {
                    $final = '';
                }
            }

            return $final;
        }

        return '';
    }
1315213
public function identifier($object): string
    {
        if (is_array($object) && isset($object['__identity'])) {
            return $object['__identity'];
        }
        if (is_string($object)) {
            return $object;
        }
        if (!is_object($object)) {
            return '';
        }
        return (string)$this->persistenceManager->getIdentifierByObject($object);
    }
221516
private function getClass($object): string
    {
        if (interface_exists('Doctrine\Common\Persistence\Proxy') && $object instanceof Proxy) {
            if (!$object->__isInitialized()) {
                $object->__load();
            }

            $reflectionParentClass = (new \ReflectionObject($object))->getParentClass();
            if ($reflectionParentClass instanceof \ReflectionClass) {
                return $reflectionParentClass->getName();
            }
        }

        return get_class($object);
    }
45095
public function getRequestString($object): string
    {
        $this->assertValid($object, ValidationException::RESPONSE);

        return $this->serializeBodyObject($object);
    }
401169
public static function urlEncodeShortName($object) {
        $classname = static::getShortName($object);
        $explode   = preg_replace("/([a-z]{1})([A-Z]{1})/", "$1-$2", $classname);
        return strtolower($explode);
    }
580997
public static function getObjectClass($object)
    {
        if(is_object($object))
        {
            if($object instanceof IBean)
            {
                return get_parent_class($object);
            }
            else
            {
                return get_class($object);
            }
        }
        else
        {
            return (string)$object;
        }
    }
516975
public static function getRealClass($object)
    {
        $class = is_object($object) ? get_class($object) : $object;

        if (class_exists('Doctrine\Common\Util\ClassUtils')) {
            return DoctrineClassUtils::getRealClass($class);
        }

        // fallback in case doctrine common  is not installed
        if (false === $pos = strrpos($class, '\\'.self::MARKER.'\\')) {
            return $class;
        }

        return substr($class, $pos + self::MARKER_LENGTH + 2);
    }
383334
private function getReflection($object)
    {
        $key = get_class($object);

        if (!array_key_exists($key, $this->buffer)) {
            $this->buffer[$key] = new \ReflectionClass($object);
        }

        return $this->buffer[$key];
    }