protected static function normalizeRelationshipData(array &$value, array $arrayData)
    {
        $relationships = [];
        foreach ($arrayData[JsonApiTransformer::RELATIONSHIPS_KEY] as $attribute => $attributeValue) {
            //if $value[data] is not found, get next level where [data] should exist.
            if (!array_key_exists(JsonApiTransformer::DATA_KEY, $attributeValue)) {
                array_shift($attributeValue);
            }


            if (count($attributeValue[JsonApiTransformer::DATA_KEY]) > 0) {
                $relationships[$attribute] = $attributeValue;
            }
        }

        return $relationships;
    }
protected static function normalizeRelationshipData(array &$value, array $arrayData)
    {
        $relationships = [];
        foreach ($arrayData[JsonApiTransformer::RELATIONSHIPS_KEY] as $attribute => $attributeValue) {
            //if $value[data] is not found, get next level where [data] should exist.
            if (!array_key_exists(JsonApiTransformer::DATA_KEY, $attributeValue)) {
                array_shift($attributeValue);
            }


            if (count($attributeValue[JsonApiTransformer::DATA_KEY]) > 0) {
                $relationships[$attribute] = $attributeValue;
            }
        }

        return $relationships;
    }
protected static function normalizeRelationshipData ( array & $ value , array $ arrayData ) { $ relationships = [ ] ; foreach ( $ arrayData [ JsonApiTransformer :: RELATIONSHIPS_KEY ] as $ attribute => $ attributeValue ) { //if $value[data] is not found, get next level where [data] should exist. if ( ! array_key_exists ( JsonApiTransformer :: DATA_KEY , $ attributeValue ) ) { array_shift ( $ attributeValue ) ; } if ( count ( $ attributeValue [ JsonApiTransformer :: DATA_KEY ] ) > 0 ) { $ relationships [ $ attribute ] = $ attributeValue ; } } return $ relationships ; }
Enforce with this check that each property leads to a data element.

@param array $arrayData

@return array
Enforce with this check that each property leads to a data element .