src/Serializer/ArraySerializer.php
public function serialize(Accessable $data)
    {
        $fullArray = (bool) $this->config['recursive'];

        if (
            $data instanceof ResourceNull
            or $data instanceof ResourceNullInterface // #TODO Don't use ResourceNullInterface anymore
        ) {
            return null;
        }

        $array = [];

        foreach ($data->getKeys() as $key) {
            $value = $data->get($key);

            if ($fullArray) {
                $array[$key] = $this->objectTransform($value);
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
public function serialize(Accessable $data)
    {
        $fullArray = (bool) $this->config['recursive'];

        if (
            $data instanceof ResourceNull
            or $data instanceof ResourceNullInterface // #TODO Don't use ResourceNullInterface anymore
        ) {
            return null;
        }

        $array = [];

        foreach ($data->getKeys() as $key) {
            $value = $data->get($key);

            if ($fullArray) {
                $array[$key] = $this->objectTransform($value);
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }
public function serialize ( Accessable $ data ) { $ fullArray = ( bool ) $ this -> config [ 'recursive' ] ; if ( $ data instanceof ResourceNull or $ data instanceof ResourceNullInterface // #TODO Don't use ResourceNullInterface anymore ) { return null ; } $ array = [ ] ; foreach ( $ data -> getKeys ( ) as $ key ) { $ value = $ data -> get ( $ key ) ; if ( $ fullArray ) { $ array [ $ key ] = $ this -> objectTransform ( $ value ) ; } else { $ array [ $ key ] = $ value ; } } return $ array ; }
Convert data in an array

@param Art4\JsonApiClient\Accessable $data The data for serialization

@return array
Convert data in an array