public function getItemId(Item $item)
    {
        /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source */
        foreach ($item->getSources() as $source) {
            if (strpos($source->getUrl(), $this->browser->getHost()) === 0 &&
                preg_match(self::REG_ITEM_ID, $source->getUrl(), $match)
            ) {
                return (int)$match['id'];
            }
        }
        return 0;
    }
public function getItemId(Item $item)
    {
        /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source */
        foreach ($item->getSources() as $source) {
            if (strpos($source->getUrl(), $this->browser->getHost()) === 0 &&
                preg_match(self::REG_ITEM_ID, $source->getUrl(), $match)
            ) {
                return (int)$match['id'];
            }
        }
        return 0;
    }
public function getItemId ( Item $ item ) { /* @var $source \AnimeDb\Bundle\CatalogBundle\Entity\Source */ foreach ( $ item -> getSources ( ) as $ source ) { if ( strpos ( $ source -> getUrl ( ) , $ this -> browser -> getHost ( ) ) === 0 && preg_match ( self :: REG_ITEM_ID , $ source -> getUrl ( ) , $ match ) ) { return ( int ) $ match [ 'id' ] ; } } return 0 ; }
Get Shikimori item id from sources

@param \AnimeDb\Bundle\CatalogBundle\Entity\Item $item

@return integer
Get Shikimori item id from sources