I am fairly new to OXID.
I am trying to perform an SQL query by using OXID functions only.
The point is to check if $discount exists in oxVoucherSerie’s table oxdiscount, and if it exists get the oxid from oxVoucherSerie that corresponds to that discount.
Sadly I cannot use plain MySQL and I am only allowed to use oxid functions. I have no idea how to do it.
public function save_voucher($discount){
$o_voucherid = oxNew("oxVoucherSerie");
$aWhere_discount['oxdiscount'] = $discount;
$sSql = $o_voucherid->buildSelectString($aWhere_discount);
$b_exists = $o_voucher->assignRecord($sSql);
}
This tells me if the discount exists. However, I have no idea to retrieve oxid from said discount.