src/RelationshipResourceFinder.php
public function fromRelationshipType($type)
    {
        $relationships = $this->getRelationshipsThatMatchType($type);

        if (count($relationships) === 0) {
            return null;
        }

        $resource = reset($relationships);

        return new RelationshipResource(
            key($relationships),
            $resource
        );
    }
public function fromRelationshipType($type)
    {
        $relationships = $this->getRelationshipsThatMatchType($type);

        if (count($relationships) === 0) {
            return null;
        }

        $resource = reset($relationships);

        return new RelationshipResource(
            key($relationships),
            $resource
        );
    }
public function fromRelationshipType ( $ type ) { $ relationships = $ this -> getRelationshipsThatMatchType ( $ type ) ; if ( count ( $ relationships ) === 0 ) { return null ; } $ resource = reset ( $ relationships ) ; return new RelationshipResource ( key ( $ relationships ) , $ resource ) ; }
Get a resource from just the relationship type.

@param string $type
@return \Drp\JsonApiParser\RelationshipResource|null
Get a resource from just the relationship type .