public function getCatalogItem(array $item)
    {
        $sources = [$this->browser->getHost().$item['url']];
        if (!empty($item['world_art_id'])) {
            $sources[] = str_replace('#ID#', $item['world_art_id'], self::WORLD_ART_URL);
        }
        if (!empty($item['myanimelist_id'])) {
            $sources[] = str_replace('#ID#', $item['myanimelist_id'], self::MY_ANIME_LIST_URL);
        }
        if (!empty($item['ani_db_id'])) {
            $sources[] = str_replace('#ID#', $item['ani_db_id'], self::ANI_DB_URL);
        }
        /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source|null */
        $source = $this->repository->findOneBy(['url' => $sources]);
        if ($source instanceof Source) {
            return $source->getItem();
        }
        return null;
    }
public function getCatalogItem(array $item)
    {
        $sources = [$this->browser->getHost().$item['url']];
        if (!empty($item['world_art_id'])) {
            $sources[] = str_replace('#ID#', $item['world_art_id'], self::WORLD_ART_URL);
        }
        if (!empty($item['myanimelist_id'])) {
            $sources[] = str_replace('#ID#', $item['myanimelist_id'], self::MY_ANIME_LIST_URL);
        }
        if (!empty($item['ani_db_id'])) {
            $sources[] = str_replace('#ID#', $item['ani_db_id'], self::ANI_DB_URL);
        }
        /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source|null */
        $source = $this->repository->findOneBy(['url' => $sources]);
        if ($source instanceof Source) {
            return $source->getItem();
        }
        return null;
    }
public function getCatalogItem ( array $ item ) { $ sources = [ $ this -> browser -> getHost ( ) . $ item [ 'url' ] ] ; if ( ! empty ( $ item [ 'world_art_id' ] ) ) { $ sources [ ] = str_replace ( '#ID#' , $ item [ 'world_art_id' ] , self :: WORLD_ART_URL ) ; } if ( ! empty ( $ item [ 'myanimelist_id' ] ) ) { $ sources [ ] = str_replace ( '#ID#' , $ item [ 'myanimelist_id' ] , self :: MY_ANIME_LIST_URL ) ; } if ( ! empty ( $ item [ 'ani_db_id' ] ) ) { $ sources [ ] = str_replace ( '#ID#' , $ item [ 'ani_db_id' ] , self :: ANI_DB_URL ) ; } /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source|null */ $ source = $ this -> repository -> findOneBy ( [ 'url' => $ sources ] ) ; if ( $ source instanceof Source ) { return $ source -> getItem ( ) ; } return null ; }
Get catalog item

@param array $item

@return \AnimeDb\Bundle\CatalogBundle\Entity\Item|null
Get catalog item