public function updateKeywordLinks(AbstractClassContent $content, $keywords, BBUserToken $token = null)
    {
        if (!is_array($keywords)) {
            $keywords = [$keywords];
        }

        foreach ($keywords as $keyword) {
            if (!($keyword instanceof Keyword)) {
                continue;
            }

            if (
                null !== $token &&
                null !== $draft = $this->_em->getRepository('BackBee\ClassContent\Revision')->getDraft($keyword, $token)
            ) {
                $keyword->setDraft($draft);
            }

            if (
                empty($keyword->value)
                || (null === $realKeyword = $this->_em->find('BackBee\NestedNode\KeyWord', $keyword->value))
            ) {
                continue;
            }

            if (!$realKeyword->getContent()->contains($content)) {
                $realKeyword->getContent()->add($content);
            }
        }
    }
public function updateKeywordLinks(AbstractClassContent $content, $keywords, BBUserToken $token = null)
    {
        if (!is_array($keywords)) {
            $keywords = [$keywords];
        }

        foreach ($keywords as $keyword) {
            if (!($keyword instanceof Keyword)) {
                continue;
            }

            if (
                null !== $token &&
                null !== $draft = $this->_em->getRepository('BackBee\ClassContent\Revision')->getDraft($keyword, $token)
            ) {
                $keyword->setDraft($draft);
            }

            if (
                empty($keyword->value)
                || (null === $realKeyword = $this->_em->find('BackBee\NestedNode\KeyWord', $keyword->value))
            ) {
                continue;
            }

            if (!$realKeyword->getContent()->contains($content)) {
                $realKeyword->getContent()->add($content);
            }
        }
    }
public function updateKeywordLinks ( AbstractClassContent $ content , $ keywords , BBUserToken $ token = null ) { if ( ! is_array ( $ keywords ) ) { $ keywords = [ $ keywords ] ; } foreach ( $ keywords as $ keyword ) { if ( ! ( $ keyword instanceof Keyword ) ) { continue ; } if ( null !== $ token && null !== $ draft = $ this -> _em -> getRepository ( 'BackBee\ClassContent\Revision' ) -> getDraft ( $ keyword , $ token ) ) { $ keyword -> setDraft ( $ draft ) ; } if ( empty ( $ keyword -> value ) || ( null === $ realKeyword = $ this -> _em -> find ( 'BackBee\NestedNode\KeyWord' , $ keyword -> value ) ) ) { continue ; } if ( ! $ realKeyword -> getContent ( ) -> contains ( $ content ) ) { $ realKeyword -> getContent ( ) -> add ( $ content ) ; } } }
Updates keywords_contents join.

@param AbstractClassContent $content
@param mixed                $keywords
@param BBUserToken          $token
Updates keywords_contents join .