src/Service/Filler.php
protected function fillAnimationNames(Item $item, \DOMXPath $xpath, \DOMElement $head)
    {
        // add main name
        $names = $xpath->query('table[1]/tr/td', $head)->item(0)->nodeValue;
        $names = explode("\n", trim($names));

        // clear
        $name = preg_replace('/\[\d{4}\]/', '', array_shift($names)); // example: [2011]
        $name = preg_replace('/\[?(ТВ|OVA|ONA)(\-\d)?\]?/', '', $name); // example: [TV-1]
        $name = preg_replace('/\(фильм \w+\)/u', '', $name); // example: (фильм седьмой)
        $name = preg_replace('/ - Фильм$/iu', '', $name); // example: - Фильм
        $item->setName(trim($name));

        // add other names
        foreach ($names as $name) {
            $name = trim(preg_replace('/(\(\d+\))?/', '', $name));
            $item->addName((new Name())->setName($name));
        }

        return $item;
    }
protected function fillAnimationNames(Item $item, \DOMXPath $xpath, \DOMElement $head)
    {
        // add main name
        $names = $xpath->query('table[1]/tr/td', $head)->item(0)->nodeValue;
        $names = explode("\n", trim($names));

        // clear
        $name = preg_replace('/\[\d{4}\]/', '', array_shift($names)); // example: [2011]
        $name = preg_replace('/\[?(ТВ|OVA|ONA)(\-\d)?\]?/', '', $name); // example: [TV-1]
        $name = preg_replace('/\(фильм \w+\)/u', '', $name); // example: (фильм седьмой)
        $name = preg_replace('/ - Фильм$/iu', '', $name); // example: - Фильм
        $item->setName(trim($name));

        // add other names
        foreach ($names as $name) {
            $name = trim(preg_replace('/(\(\d+\))?/', '', $name));
            $item->addName((new Name())->setName($name));
        }

        return $item;
    }
protected function fillAnimationNames ( Item $ item , \ DOMXPath $ xpath , \ DOMElement $ head ) { // add main name $ names = $ xpath -> query ( 'table[1]/tr/td' , $ head ) -> item ( 0 ) -> nodeValue ; $ names = explode ( "\n" , trim ( $ names ) ) ; // clear $ name = preg_replace ( '/\[\d{4}\]/' , '' , array_shift ( $ names ) ) ; // example: [2011] $ name = preg_replace ( '/\[?(ТВ|OVA|ONA)(\-\d)?\]?/',  ' ,  $ a me); /  example: [TV-1] $ name = preg_replace ( '/\(фильм \w+\)/u', '', na m ) ; // e ample: (фильм седьмой) $ name = preg_replace ( '/ - Фильм$/iu', '', na m ) ; // e ample: - Фильм $ item -> setName ( trim ( $ name ) ) ; // add other names foreach ( $ names as $ name ) { $ name = trim ( preg_replace ( '/(\(\d+\))?/' , '' , $ name ) ) ; $ item -> addName ( ( new Name ( ) ) -> setName ( $ name ) ) ; } return $ item ; }
Fill names for Animation type.

@param \AnimeDb\Bundle\CatalogBundle\Entity\Item $item
@param \DOMXPath                                 $xpath
@param \DOMElement                               $head

@return \AnimeDb\Bundle\CatalogBundle\Entity\Item
Fill names for Animation type .