plugin/competency/Manager/ResourceManager.php
public function removeLink(ResourceNode $resource, $target)
    {
        if (!$target instanceof Ability && !$target instanceof Competency) {
            throw new \InvalidArgumentException(
                'Second argument must be a Competency or an Ability instance'
            );
        }

        if (!$target->isLinkedToResource($resource)) {
            throw new \LogicException(
                "There's no link between resource {$resource->getId()} and target {$target->getId()}"
            );
        }

        $target->removeResource($resource);
        $this->om->flush();
    }
public function removeLink(ResourceNode $resource, $target)
    {
        if (!$target instanceof Ability && !$target instanceof Competency) {
            throw new \InvalidArgumentException(
                'Second argument must be a Competency or an Ability instance'
            );
        }

        if (!$target->isLinkedToResource($resource)) {
            throw new \LogicException(
                "There's no link between resource {$resource->getId()} and target {$target->getId()}"
            );
        }

        $target->removeResource($resource);
        $this->om->flush();
    }
public function removeLink ( ResourceNode $ resource , $ target ) { if ( ! $ target instanceof Ability && ! $ target instanceof Competency ) { throw new \ InvalidArgumentException ( 'Second argument must be a Competency or an Ability instance' ) ; } if ( ! $ target -> isLinkedToResource ( $ resource ) ) { throw new \ LogicException ( "There's no link between resource {$resource->getId()} and target {$target->getId()}" ) ; } $ target -> removeResource ( $ resource ) ; $ this -> om -> flush ( ) ; }
Removes a link between a resource and an ability or a competency.

@param ResourceNode       $resource
@param Ability|Competency $target

@throws \InvalidArgumentException if the target isn't an instance of Ability or Competency
@throws \LogicException           if the link doesn't exists
Removes a link between a resource and an ability or a competency .