private function checkId($context, $id)
    {
        $ret = false;
        if (is_numeric($id)){
            if ("catalog" === $context){
                $cat = CategoryQuery::create()->findPk($id);
                $ret = (null !== $cat && $cat->getVisible());
            } elseif ("brand" === $context) {
                $brand = BrandQuery::create()->findPk($id);
                $ret = (null !== $brand && $brand->getVisible());
            } else {
                $folder = FolderQuery::create()->findPk($id);
                $ret = (null !== $folder && $folder->getVisible());
            }
        }
        return $ret;
    }
private function checkId($context, $id)
    {
        $ret = false;
        if (is_numeric($id)){
            if ("catalog" === $context){
                $cat = CategoryQuery::create()->findPk($id);
                $ret = (null !== $cat && $cat->getVisible());
            } elseif ("brand" === $context) {
                $brand = BrandQuery::create()->findPk($id);
                $ret = (null !== $brand && $brand->getVisible());
            } else {
                $folder = FolderQuery::create()->findPk($id);
                $ret = (null !== $folder && $folder->getVisible());
            }
        }
        return $ret;
    }
private function checkId ( $ context , $ id ) { $ ret = false ; if ( is_numeric ( $ id ) ) { if ( "catalog" === $ context ) { $ cat = CategoryQuery :: create ( ) -> findPk ( $ id ) ; $ ret = ( null !== $ cat && $ cat -> getVisible ( ) ) ; } elseif ( "brand" === $ context ) { $ brand = BrandQuery :: create ( ) -> findPk ( $ id ) ; $ ret = ( null !== $ brand && $ brand -> getVisible ( ) ) ; } else { $ folder = FolderQuery :: create ( ) -> findPk ( $ id ) ; $ ret = ( null !== $ folder && $ folder -> getVisible ( ) ) ; } } return $ ret ; }
Check if the element exists and is visible

@param $context string   catalog or content
@param $id string        id of the element
@return bool
Check if the element exists and is visible