library/Drakojn/Io/Mapper/Map.php
public function getData($object)
    {
        if (!$this->validateObject($object)) {
            throw new InvalidArgumentException(
                "Given object isn't instance of {$this->localName}"
            );
        }
        $reflection = new ReflectionObject($object);
        $data       = [];
        foreach (array_keys($this->properties) as $localProperty) {
            $property = $reflection->getProperty($localProperty);
            $property->setAccessible(true);
            $data[$localProperty] = $property->getValue($object);
        }
        return $data;
    }
public function getData($object)
    {
        if (!$this->validateObject($object)) {
            throw new InvalidArgumentException(
                "Given object isn't instance of {$this->localName}"
            );
        }
        $reflection = new ReflectionObject($object);
        $data       = [];
        foreach (array_keys($this->properties) as $localProperty) {
            $property = $reflection->getProperty($localProperty);
            $property->setAccessible(true);
            $data[$localProperty] = $property->getValue($object);
        }
        return $data;
    }
Extract values from a given object

@param object $object

@return array
@throws InvalidArgumentException