public static function findByKey($nb_commerce, $key)
    {
        $nb_commerce_id = nb_getMixedValue($nb_commerce, 'nb_commerce_id');
        if (is_numeric($nb_commerce_id)) {
            $retval = CNabuCommerceProductCategory::buildObjectFromSQL(
                    'select * '
                    . 'from nb_commerce_product_category '
                   . 'where nb_commerce_id=%commerce_id$d '
                     . "and nb_commerce_product_category_key='%key\$s'",
                    array(
                        'commerce_id' => $nb_commerce_id,
                        'key' => $key
                    )
            );
        } else {
            $retval = null;
        }
        
        return $retval;
    }
public static function findByKey($nb_commerce, $key)
    {
        $nb_commerce_id = nb_getMixedValue($nb_commerce, 'nb_commerce_id');
        if (is_numeric($nb_commerce_id)) {
            $retval = CNabuCommerceProductCategory::buildObjectFromSQL(
                    'select * '
                    . 'from nb_commerce_product_category '
                   . 'where nb_commerce_id=%commerce_id$d '
                     . "and nb_commerce_product_category_key='%key\$s'",
                    array(
                        'commerce_id' => $nb_commerce_id,
                        'key' => $key
                    )
            );
        } else {
            $retval = null;
        }
        
        return $retval;
    }
public static function findByKey ( $ nb_commerce , $ key ) { $ nb_commerce_id = nb_getMixedValue ( $ nb_commerce , 'nb_commerce_id' ) ; if ( is_numeric ( $ nb_commerce_id ) ) { $ retval = CNabuCommerceProductCategory :: buildObjectFromSQL ( 'select * ' . 'from nb_commerce_product_category ' . 'where nb_commerce_id=%commerce_id$d ' . "and nb_commerce_product_category_key='%key\$s'" , array ( 'commerce_id' => $ nb_commerce_id , 'key' => $ key ) ) ; } else { $ retval = null ; } return $ retval ; }
Find an instance identified by nb_commerce_product_category_key field.
@param mixed $nb_commerce Commerce that owns Commerce Product Category
@param string $key Key to search
@return CNabuCommerceProductCategory Returns a valid instance if exists or null if not.
Find an instance identified by nb_commerce_product_category_key field .