plugin/competency/Manager/CompetencyManager.php
public function associateCompetencyToResources(Competency $competency, array $nodes)
    {
        $associatedNodes = [];

        foreach ($nodes as $node) {
            if (!$competency->isLinkedToResource($node)) {
                $competency->linkResource($node);
                $associatedNodes[] = $node;
            }
        }
        $this->om->persist($competency);
        $this->om->flush();

        return $associatedNodes;
    }
public function associateCompetencyToResources(Competency $competency, array $nodes)
    {
        $associatedNodes = [];

        foreach ($nodes as $node) {
            if (!$competency->isLinkedToResource($node)) {
                $competency->linkResource($node);
                $associatedNodes[] = $node;
            }
        }
        $this->om->persist($competency);
        $this->om->flush();

        return $associatedNodes;
    }
public function associateCompetencyToResources ( Competency $ competency , array $ nodes ) { $ associatedNodes = [ ] ; foreach ( $ nodes as $ node ) { if ( ! $ competency -> isLinkedToResource ( $ node ) ) { $ competency -> linkResource ( $ node ) ; $ associatedNodes [ ] = $ node ; } } $ this -> om -> persist ( $ competency ) ; $ this -> om -> flush ( ) ; return $ associatedNodes ; }
Associates a competency to several resource nodes.

@param Competency $competency
@param array      $nodes

@return string
Associates a competency to several resource nodes .