public function applyEntity(Resource $resource, EntityInterface $entity)
    {
        $this->validateResourceTypes($resource->getEntityType(), $entity->getType());
        $document->pushData($entity);
        return $this;
    }
public function applyEntity(Resource $resource, EntityInterface $entity)
    {
        $this->validateResourceTypes($resource->getEntityType(), $entity->getType());
        $document->pushData($entity);
        return $this;
    }
public function applyEntity ( Resource $ resource , EntityInterface $ entity ) { $ this -> validateResourceTypes ( $ resource -> getEntityType ( ) , $ entity -> getType ( ) ) ; $ document -> pushData ( $ entity ) ; return $ this ; }
Applies an entity or entity identifier to a resource.

@param   Resource            $document   The primary resource.
@param   EntityInterface     $entity     The entity or entity identifier to add.
@return  self
Applies an entity or entity identifier to a resource .