plugin/competency/Repository/CompetencyAbilityRepository.php
public function findOneByTerms(Competency $parent, Ability $ability)
    {
        $link = $this->findOneBy(['competency' => $parent, 'ability' => $ability]);

        if (!$link) {
            throw new \RuntimeException(
                "Competency {$parent->getId()} is not linked to ability {$ability->getId()}"
            );
        }

        return $link;
    }
public function findOneByTerms(Competency $parent, Ability $ability)
    {
        $link = $this->findOneBy(['competency' => $parent, 'ability' => $ability]);

        if (!$link) {
            throw new \RuntimeException(
                "Competency {$parent->getId()} is not linked to ability {$ability->getId()}"
            );
        }

        return $link;
    }
public function findOneByTerms ( Competency $ parent , Ability $ ability ) { $ link = $ this -> findOneBy ( [ 'competency' => $ parent , 'ability' => $ ability ] ) ; if ( ! $ link ) { throw new \ RuntimeException ( "Competency {$parent->getId()} is not linked to ability {$ability->getId()}" ) ; } return $ link ; }
Returns the association between a competency and an ability.

@param Competency $parent
@param Ability    $ability

@return null|object

@throws \Exception if the ability is not linked to the competency
Returns the association between a competency and an ability .