protected function getExistingTaxonomies($entity)
    {
        // Fetch existing taxonomies
        $query = $this->em->createQueryBuilder()
            ->select('*')
            ->from($this->mapping['target'])
            ->where('content_id = :content_id')
            ->andWhere('contenttype = :contenttype')
            ->andWhere('taxonomytype = :taxonomytype')
            ->setParameters([
                'content_id'   => $entity->id,
                'contenttype'  => $entity->getContenttype(),
                'taxonomytype' => $this->mapping['fieldname'],
            ]);
        $result = $query->execute()
            ->fetchAll();

        return $result ?: [];
    }
protected function getExistingTaxonomies($entity)
    {
        // Fetch existing taxonomies
        $query = $this->em->createQueryBuilder()
            ->select('*')
            ->from($this->mapping['target'])
            ->where('content_id = :content_id')
            ->andWhere('contenttype = :contenttype')
            ->andWhere('taxonomytype = :taxonomytype')
            ->setParameters([
                'content_id'   => $entity->id,
                'contenttype'  => $entity->getContenttype(),
                'taxonomytype' => $this->mapping['fieldname'],
            ]);
        $result = $query->execute()
            ->fetchAll();

        return $result ?: [];
    }
protected function getExistingTaxonomies ( $ entity ) { // Fetch existing taxonomies $ query = $ this -> em -> createQueryBuilder ( ) -> select ( '*' ) -> from ( $ this -> mapping [ 'target' ] ) -> where ( 'content_id = :content_id' ) -> andWhere ( 'contenttype = :contenttype' ) -> andWhere ( 'taxonomytype = :taxonomytype' ) -> setParameters ( [ 'content_id' => $ entity -> id , 'contenttype' => $ entity -> getContenttype ( ) , 'taxonomytype' => $ this -> mapping [ 'fieldname' ] , ] ) ; $ result = $ query -> execute ( ) -> fetchAll ( ) ; return $ result ? : [ ] ; }
Direct query to get existing taxonomy records.

@param mixed $entity

@return array
Direct query to get existing taxonomy records .