src/Money/Component/Parser/Csv/ParserAbstract.php
protected function getLineCategory(Account $account)
    {
        /** @var $categoriesWords CategoryWord[] */
        static $categoriesWords = array();

        if (empty($categoriesWords)) {
            $categoryMapper = new CategoryMapper(Database::get('money'));
            $categoryMapper->addWhere('account_id', $account->getId());
            $categories     = $categoryMapper->select();

            foreach ($categories as $category) {
                $words = $category->getAllCategoryWord();

                foreach ($words as $categoryWord) {
                    $categoriesWords[$categoryWord->getName()] = $categoryWord;
                }
            }
        }

        $name = strtolower($this->getLineName());

        foreach ($categoriesWords as $word => $categoryWord) {
            if (empty($word)) {
                continue;
            }

            if (strpos($name, $word) !== false) {
                return $categoryWord->getCategoryId();
            }
        }

        return 0;
    }
protected function getLineCategory(Account $account)
    {
        /** @var $categoriesWords CategoryWord[] */
        static $categoriesWords = array();

        if (empty($categoriesWords)) {
            $categoryMapper = new CategoryMapper(Database::get('money'));
            $categoryMapper->addWhere('account_id', $account->getId());
            $categories     = $categoryMapper->select();

            foreach ($categories as $category) {
                $words = $category->getAllCategoryWord();

                foreach ($words as $categoryWord) {
                    $categoriesWords[$categoryWord->getName()] = $categoryWord;
                }
            }
        }

        $name = strtolower($this->getLineName());

        foreach ($categoriesWords as $word => $categoryWord) {
            if (empty($word)) {
                continue;
            }

            if (strpos($name, $word) !== false) {
                return $categoryWord->getCategoryId();
            }
        }

        return 0;
    }
Get category

@param  Account $account
@return int