src/Record/Transformer.php
public static function toArray($data)
    {
        $visitor   = new ArraySerializeVisitor();
        $traverser = new GraphTraverser();
        $traverser->traverse($data, $visitor);

        return $visitor->getObject();
    }
public static function toArray($data)
    {
        $visitor   = new ArraySerializeVisitor();
        $traverser = new GraphTraverser();
        $traverser->traverse($data, $visitor);

        return $visitor->getObject();
    }
Transforms an arbitrary data structure into a stdClass graph

@param mixed $data
@return array