Table::findUniquePage($field)

Version 4.1

Find or create page with given unique values

Find a page with given unique values. If page was not found, creates a new page and sets unique values to it.

Given values are NOT parsed through fieldtype query parser. Ie. given values are directly used in MySQL query and value setting.

Return value

Object Page

Arguments

$field
Array(fieldname=>value)

Full documentation

Add a product price for certain customer. Load/Add price -page with customer/product -values, set amount and save.

$this->get('table','product_price')->findUniquePage(Array(
    'customer' => $customer->getId(),
    'product'  => $product->getId()
))->setValue('amount',$amount)->save();