returns the version from a given object

@param object $object object

@return int|null null or the specified version
551944
private function getVersionFromObject($object)
    {
        $version = null;

        if ($this->accessor->isReadable($object, self::FIELD_NAME)) {
            $version = $this->accessor->getValue($object, self::FIELD_NAME);
        }
        return $version;
    }
1307522
public static function getClass($object)
    {
        $inflector                       = self::$classNameInflector
            ?? self::$classNameInflector = (new Configuration())->getClassNameInflector();

        return $inflector->getUserClassName(get_class($object));
    }
332563
public static function getTable($object)
    {
        $tableAnnotation = static::getAnnotation($object, Table::class);
        if(null !== $tableAnnotation)
        {
            return $tableAnnotation->name;
        }
        else
        {
            return null;
        }
    }
1088260
public function getObjectIdentity($object)
    {
        foreach ($this->configurations as $config) {
            if ($config->isRelevant($object)) {
                return $config->getObjectIdentity();
            }
        }

        return null;
    }
580944
protected function getSetProps($object = null) {
    $object = $object ?: $this->value;
    if (gettype($object) !== 'object') {
      return [];
    }

    return array_keys((array) $object);
  }
1271047
public function getValue($object)
    {
        $this->reflectionProperty->setAccessible(true);

        return $this->reflectionProperty->getValue($object);
    }
422700
public function convert($object)
    {
        if (!\is_object($object)) {
            throw new \InvalidArgumentException('Transferred object must be a real object. Got ' . \gettype($object));
        }

        return $this->getLegacyKernel()->runCallback(
            static function () use ($object) {
                if ($object instanceof Content) {
                    return eZContentObject::fetch($object->getVersionInfo()->getContentInfo()->id);
                } elseif ($object instanceof Location) {
                    return eZContentObjectTreeNode::fetch($object->id);
                } elseif ($object instanceof VersionInfo) {
                    return eZContentObjectVersion::fetchVersion($object->versionNo, $object->getContentInfo()->id);
                }
            },
            false,
            false
        );
    }
837349
public function getMethod($object)
    {
        if (null === $object) {
            return false;
        }

        foreach ($this->classes as $class => $identifier) {
            if ($object instanceof $class) {
                return $identifier;
            }
        }

        $class = \get_class($object);

        if (method_exists($object, 'getCacheIdentifier')) {
            $this->addClass($class, 'getCacheIdentifier');
        } elseif (method_exists($object, 'getId')) {
            $this->addClass($class, 'getId');
        } else {
            return false;
        }

        return $this->classes[$class];
    }
950772
private function getObjectVersion($id = null) {

		if(!empty($id) && !empty($this->versionedIds[$id])) {
			return $this->versionedIds[$id];
		}

		$date_format = 'dHis';
		// Use current time so that object version is unique
		$time = current_time('timestamp');

		$object_version = date($date_format, $time).'/';
		$object_version = apply_filters('as3cf_get_object_version_string', $object_version);

		if(!empty($id)) {
			$this->versionedIds[$id] = $object_version;
		}

		return $object_version;
	}
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);
    }
129541
protected static function readObject($object): string
    {
        if ($object instanceof Closure) {
            return 'Function';
        }

        if ($object instanceof DateTime) {
            return sprintf('DateTime(%s)', $object->format('Y-m-d\TH:i:sP'));
        }

        if (method_exists($object, 'toString')) {
            return (string) $object->toString();
        }

        if (method_exists($object, '__toString')) {
            return (string) $object;
        }

        return sprintf('Object(%s)', get_class($object));
    }
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;
        }
    }
998106
public static function getTransformer($object)
	{
		$class = get_class($object);
		
		if (isset(static::$transformations[$class])) {
			return new static::$transformations[$class];
		}
		
		if (isset($object->transformer)) {
			return new $object->transformer;
		}
		
		return null;
	}
927234
protected function getIdentifierFromObject($object)
    {
        $class = get_class($object);
        $meta = $this->entityMetadataFactory->getMetadataFor($class);
        $values = $meta->getIdentifierValues($object);

        $values = array_map(
            function ($value) {
                if (is_object($value)) {
                    return $this->getIdentifierFromObject($value);
                }

                return $value;
            },
            $values
        );

        return $values;
    }
1070678
protected function getValue($object, $property)
    {
        if (isset($object->{$property})) {
            return $object->{$property};
        }

        $reflectionClass = new ReflectionClass($object);

        if (!$reflectionClass->hasProperty($property)) {
            return null;
        }

        $reflectionProperty = $reflectionClass->getProperty($property);
        $reflectionProperty->setAccessible(true);

        return $reflectionProperty->getValue($object);
    }
448068
protected function _getVersion($component)
    {
        if (!isset(self::$_versions[$component]))
        {
            try
            {
                if ($component === 'koowa') {
                    $version = Koowa::VERSION;
                }
                else $version = $this->getObject('com://admin/' . $component.'.version')->getVersion();
            }
            catch (Exception $e) {
                $version = null;
            }

            self::$_versions[$component] = $version;
        }

        return self::$_versions[$component];
    }
682604
public function getLastChange($object)
    {
        $lastChange = null;
        $allChanges = $this->getAllChanges($object);
        if (count($allChanges)) {
            $lastChange = end($allChanges);
        }
        return $lastChange;
    }