Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Update src/morph/Query.php #42

Merged
merged 1 commit into from

2 participants

@daniphp

Added support for logical operators like: $or/$and

@daniphp daniphp Update src/morph/Query.php
Added support for logical operators like: $or/$and
3912cbc
@a-musing-moose a-musing-moose merged commit d0a22ca into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Sep 24, 2012
  1. @daniphp

    Update src/morph/Query.php

    daniphp authored
    Added support for logical operators like: $or/$and
This page is out of date. Refresh to see the latest.
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/morph/Query.php
View
15 src/morph/Query.php
@@ -47,6 +47,11 @@ class Query implements IQuery
* @var array
*/
private $criteria;
+
+ /**
+ * @var array
+ */
+ private $operator;
/**
* @var int
@@ -167,6 +172,12 @@ public function getRawQuery()
}
}
}
+
+ if (count($this->operator) > 0) {
+ foreach ($this->operator as $operatorName => $operator) {
+ $query[$operatorName] = $operator;
+ }
+ }
return $query;
}
@@ -192,4 +203,8 @@ public function getRawSort()
}
return $sort;
}
+
+ public function operator($operator, IQuery $query1, IQuery $query2) {
+ $this->operator[$operator] = array($query1->getRawQuery(), $query2->getRawQuery());
+ }
}
Something went wrong with that request. Please try again.