@@ 816-829 (lines=14) @@ | ||
813 | * |
|
814 | * @see where() |
|
815 | */ |
|
816 | public function andWhere($where) |
|
817 | { |
|
818 | $args = func_get_args(); |
|
819 | $where = $this->getQueryPart('where'); |
|
820 | ||
821 | if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_AND) { |
|
822 | $where->addMultiple($args); |
|
823 | } else { |
|
824 | array_unshift($args, $where); |
|
825 | $where = new CompositeExpression(CompositeExpression::TYPE_AND, $args); |
|
826 | } |
|
827 | ||
828 | return $this->add('where', $where, true); |
|
829 | } |
|
830 | ||
831 | /** |
|
832 | * Adds one or more restrictions to the query results, forming a logical |
|
@@ 849-862 (lines=14) @@ | ||
846 | * |
|
847 | * @see where() |
|
848 | */ |
|
849 | public function orWhere($where) |
|
850 | { |
|
851 | $args = func_get_args(); |
|
852 | $where = $this->getQueryPart('where'); |
|
853 | ||
854 | if ($where instanceof CompositeExpression && $where->getType() === CompositeExpression::TYPE_OR) { |
|
855 | $where->addMultiple($args); |
|
856 | } else { |
|
857 | array_unshift($args, $where); |
|
858 | $where = new CompositeExpression(CompositeExpression::TYPE_OR, $args); |
|
859 | } |
|
860 | ||
861 | return $this->add('where', $where, true); |
|
862 | } |
|
863 | ||
864 | /** |
|
865 | * Specifies a grouping over the results of the query. |
|
@@ 992-1005 (lines=14) @@ | ||
989 | * |
|
990 | * @return $this This QueryBuilder instance. |
|
991 | */ |
|
992 | public function andHaving($having) |
|
993 | { |
|
994 | $args = func_get_args(); |
|
995 | $having = $this->getQueryPart('having'); |
|
996 | ||
997 | if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_AND) { |
|
998 | $having->addMultiple($args); |
|
999 | } else { |
|
1000 | array_unshift($args, $having); |
|
1001 | $having = new CompositeExpression(CompositeExpression::TYPE_AND, $args); |
|
1002 | } |
|
1003 | ||
1004 | return $this->add('having', $having); |
|
1005 | } |
|
1006 | ||
1007 | /** |
|
1008 | * Adds a restriction over the groups of the query, forming a logical |
|
@@ 1015-1028 (lines=14) @@ | ||
1012 | * |
|
1013 | * @return $this This QueryBuilder instance. |
|
1014 | */ |
|
1015 | public function orHaving($having) |
|
1016 | { |
|
1017 | $args = func_get_args(); |
|
1018 | $having = $this->getQueryPart('having'); |
|
1019 | ||
1020 | if ($having instanceof CompositeExpression && $having->getType() === CompositeExpression::TYPE_OR) { |
|
1021 | $having->addMultiple($args); |
|
1022 | } else { |
|
1023 | array_unshift($args, $having); |
|
1024 | $having = new CompositeExpression(CompositeExpression::TYPE_OR, $args); |
|
1025 | } |
|
1026 | ||
1027 | return $this->add('having', $having); |
|
1028 | } |
|
1029 | ||
1030 | /** |
|
1031 | * Specifies an ordering for the query results. |