Mongolid\DataMapper\SchemaMapper::parseToArray PHP Method

parseToArray() protected method

Parses an object to an array before sending it to the SchemaMapper.
protected parseToArray ( mixed $object ) : array
$object mixed The object that will be transformed into an array.
return array
    protected function parseToArray($object) : array
    {
        if (!is_array($object)) {
            $attributes = method_exists($object, 'getAttributes') ? $object->getAttributes() : get_object_vars($object);
            return $attributes;
        }
        return $object;
    }