return $order_ids;
}
- function get_contact_orders($contact, $state_mask = null) {
+ function get_beneficiary_orders($contact, $state_mask = null) {
$q = new OrderQuery;
$q->filterByBeneficiaryId($contact->getId());
if ($state_mask) $q->filterById(get_order_ids_by_state($state_mask));
return $q->orderByDate()->find();
}
+ function get_requester_orders($contact, $state_mask = null) {
+ $q = new OrderQuery;
+ $q->filterByRequesterId($contact->getId());
+ if ($state_mask) $q->filterById(get_order_ids_by_state($state_mask));
+ return $q->orderByDate()->find();
+ }
+
+ function get_contact_orders($contact, $state_mask = null) {
+ $q = new OrderQuery;
+ $q->filterByBeneficiaryId($contact->getId())->_or()->filterByRequesterId($contact->getId());
+ if ($state_mask) $q->filterById(get_order_ids_by_state($state_mask));
+ return $q->orderByDate()->find();
+ }
+
function get_user_by_contact_id($id, $verbose = true) {
$q = new UserQuery;
$user = $q->findOneByContactId($id);