Page::findPagesWithSame($fields[,$include_self])

Version 3.8

Get pages that have same value

Return value

Object Pages

Arguments

$kentat
List of fields to match against, delimited with &
If you give search clause 'field!=', value of field in this page is used.
If you give search value with 'field=value', it is used as in $Pages->hae()
$include_self
Add this page to the query
Default: false

Full documentation

Get other Orders for the same client:

$Orders = $Order->findPagesWithSame('client');

Get Orders for the same client, this Order included:

$Orders = $Order->findPagesWithSame('client',true);

Get other Orders for the same client that are currently ready:

$Orders = $Order->findPagesWithSame('client&status=Ready');

Get other Orders for the same client that are not in the same status:

$Orders = $Order->findPagesWithSame('client&status!=');

Get other Orders for the same client that are older:

$Orders = $Order->findPagesWithSame('client&order_number<');
// NOTE!!! hakee <=, mutta include_self pudottaa kyeisen laskun pois.

Get other Orders for the same client that are newer:

$Orders = $Order->findPagesWithSame('client&order_number>');
// NOTE!!! hakee >=, mutta include_self pudottaa kyseisen laskun pois.

Get other Orders for the same client that have lower or same price:

$Orders = $Order->findPagesWithSame('client&total_amount<=');

Get other Orders for the same client that have higher or same price:

$Orders = $Order->findPagesWithSame('client& total_amount>=');

Reference -field

Get other Order Rows that are in the same Order than this row:

$Orderrows = $OrderRow->findPagesWithSame('order__orderrows');

Get all Order Rows that are in the same Order and have the same product than this row:

$Orderrows = $OrderRow->findPagesWithSame('order__orderrows&product',true);