public function brandDataAccess($params, &$smarty)
    {
        $brandId = $this->getRequest()->get('brand_id');

        if ($brandId === null) {
            $productId = $this->getRequest()->get('product_id');

            if ($productId !== null) {
                if (null !== $product = ProductQuery::create()->findPk($productId)) {
                    $brandId = $product->getBrandId();
                }
            }
        }

        if ($brandId !== null) {
            return $this->dataAccessWithI18n(
                "Brand",
                $params,
                BrandQuery::create()->filterByPrimaryKey($brandId)
            );
        }

        return '';
    }
public function brandDataAccess($params, &$smarty)
    {
        $brandId = $this->getRequest()->get('brand_id');

        if ($brandId === null) {
            $productId = $this->getRequest()->get('product_id');

            if ($productId !== null) {
                if (null !== $product = ProductQuery::create()->findPk($productId)) {
                    $brandId = $product->getBrandId();
                }
            }
        }

        if ($brandId !== null) {
            return $this->dataAccessWithI18n(
                "Brand",
                $params,
                BrandQuery::create()->filterByPrimaryKey($brandId)
            );
        }

        return '';
    }
public function brandDataAccess ( $ params , & $ smarty ) { $ brandId = $ this -> getRequest ( ) -> get ( 'brand_id' ) ; if ( $ brandId === null ) { $ productId = $ this -> getRequest ( ) -> get ( 'product_id' ) ; if ( $ productId !== null ) { if ( null !== $ product = ProductQuery :: create ( ) -> findPk ( $ productId ) ) { $ brandId = $ product -> getBrandId ( ) ; } } } if ( $ brandId !== null ) { return $ this -> dataAccessWithI18n ( "Brand" , $ params , BrandQuery :: create ( ) -> filterByPrimaryKey ( $ brandId ) ) ; } return '' ; }
Provides access to an attribute of the current brand

@param  array $params
@param  \Smarty $smarty
@return string the value of the requested attribute
Provides access to an attribute of the current brand