protected function transformRelated($itemTransformation, $item)
    {
        foreach ($this->related as $relation) {
            // get direct relation name.
            $relationName = explode('.', $relation, 2)[0];
            $itemTransformation[$relationName] = $this->getRelatedTransformation($item, $relation);
        }

        return $itemTransformation;
    }
protected function transformRelated($itemTransformation, $item)
    {
        foreach ($this->related as $relation) {
            // get direct relation name.
            $relationName = explode('.', $relation, 2)[0];
            $itemTransformation[$relationName] = $this->getRelatedTransformation($item, $relation);
        }

        return $itemTransformation;
    }
protected function transformRelated ( $ itemTransformation , $ item ) { foreach ( $ this -> related as $ relation ) { // get direct relation name. $ relationName = explode ( '.' , $ relation , 2 ) [ 0 ] ; $ itemTransformation [ $ relationName ] = $ this -> getRelatedTransformation ( $ item , $ relation ) ; } return $ itemTransformation ; }
Transforms the related item, and adds it to the transformation array.

@param $itemTransformation
@param $item
@return array
Transforms the related item and adds it to the transformation array .