public function getDiscount()
    {
        $discounts = ArrayList::create();

        foreach ($this->owner->Groups() as $group) {
            foreach ($group->Discounts() as $discount) {
                $discounts->add($discount);
            }
        }

        $discounts->sort("Amount", "DESC");

        return $discounts->first();
    }
public function getDiscount()
    {
        $discounts = ArrayList::create();

        foreach ($this->owner->Groups() as $group) {
            foreach ($group->Discounts() as $discount) {
                $discounts->add($discount);
            }
        }

        $discounts->sort("Amount", "DESC");

        return $discounts->first();
    }
public function getDiscount ( ) { $ discounts = ArrayList :: create ( ) ; foreach ( $ this -> owner -> Groups ( ) as $ group ) { foreach ( $ group -> Discounts ( ) as $ discount ) { $ discounts -> add ( $ discount ) ; } } $ discounts -> sort ( "Amount" , "DESC" ) ; return $ discounts -> first ( ) ; }
Get a discount from the groups this member is in

@return Discount
Get a discount from the groups this member is in