public function getCategory($importCategoryId, $dispatchException = false)
    {
        $category = (new ImportCategoryQuery)->findPk($importCategoryId);

        if ($category === null && $dispatchException) {
            throw new \ErrorException(
                Translator::getInstance()->trans(
                    'There is no id "%id" in the import categories',
                    [
                        '%id' => $importCategoryId
                    ]
                )
            );
        }

        return $category;
    }
public function getCategory($importCategoryId, $dispatchException = false)
    {
        $category = (new ImportCategoryQuery)->findPk($importCategoryId);

        if ($category === null && $dispatchException) {
            throw new \ErrorException(
                Translator::getInstance()->trans(
                    'There is no id "%id" in the import categories',
                    [
                        '%id' => $importCategoryId
                    ]
                )
            );
        }

        return $category;
    }
public function getCategory ( $ importCategoryId , $ dispatchException = false ) { $ category = ( new ImportCategoryQuery ) -> findPk ( $ importCategoryId ) ; if ( $ category === null && $ dispatchException ) { throw new \ ErrorException ( Translator :: getInstance ( ) -> trans ( 'There is no id "%id" in the import categories' , [ '%id' => $ importCategoryId ] ) ) ; } return $ category ; }
Get import category model based on given identifier

@param integer $importCategoryId  An import category identifier
@param boolean $dispatchException Dispatch exception if model doesn't exist

@throws \ErrorException

@return null|\Thelia\Model\ImportCategory
Get import category model based on given identifier