src/RelationshipResourceFinder.php
protected function getRelationshipResourceForReference($fullRelationshipReference)
    {
        $relationshipParts = explode('.', $fullRelationshipReference);

        if (count($relationshipParts) !== 3) {
            return null;
        }

        if ($this->resourceType() !== array_shift($relationshipParts)) {
            return null;
        }

        $relationshipName = array_shift($relationshipParts);
        $relationshipReference = Arr::get(
            $this->mapRelationshipsToIdAndData(),
            $relationshipName
        );
        if ($relationshipReference === null) {
            return null;
        }

        if (Arr::get($relationshipReference, 'type') === array_shift($relationshipParts)) {
            return new RelationshipResource($relationshipName, $relationshipReference);
        }

        return null;
    }
protected function getRelationshipResourceForReference($fullRelationshipReference)
    {
        $relationshipParts = explode('.', $fullRelationshipReference);

        if (count($relationshipParts) !== 3) {
            return null;
        }

        if ($this->resourceType() !== array_shift($relationshipParts)) {
            return null;
        }

        $relationshipName = array_shift($relationshipParts);
        $relationshipReference = Arr::get(
            $this->mapRelationshipsToIdAndData(),
            $relationshipName
        );
        if ($relationshipReference === null) {
            return null;
        }

        if (Arr::get($relationshipReference, 'type') === array_shift($relationshipParts)) {
            return new RelationshipResource($relationshipName, $relationshipReference);
        }

        return null;
    }
protected function getRelationshipResourceForReference ( $ fullRelationshipReference ) { $ relationshipParts = explode ( '.' , $ fullRelationshipReference ) ; if ( count ( $ relationshipParts ) !== 3 ) { return null ; } if ( $ this -> resourceType ( ) !== array_shift ( $ relationshipParts ) ) { return null ; } $ relationshipName = array_shift ( $ relationshipParts ) ; $ relationshipReference = Arr :: get ( $ this -> mapRelationshipsToIdAndData ( ) , $ relationshipName ) ; if ( $ relationshipReference === null ) { return null ; } if ( Arr :: get ( $ relationshipReference , 'type' ) === array_shift ( $ relationshipParts ) ) { return new RelationshipResource ( $ relationshipName , $ relationshipReference ) ; } return null ; }
Get a relationship resource for a fully qualified reference.

@param string $fullRelationshipReference
@return \Drp\JsonApiParser\RelationshipResource|null
Get a relationship resource for a fully qualified reference .