@@ -792,11 +792,11 @@ function sql_build_query($query, $array)
792792
793793 return $ sql ;
794794 }
795-
796-
795+
796+
797797 protected function _process_boolean_tree_first ($ operations_ary )
798798 {
799- if ($ operations_ary [0 ] !== 'AND ' &&
799+ if ($ operations_ary [0 ] !== 'AND ' &&
800800 $ operations_ary [0 ] !== 'OR ' )
801801 {
802802 $ operations_ary = array ('AND ' , $ operations_ary );
@@ -807,71 +807,71 @@ protected function _process_boolean_tree_first($operations_ary)
807807 protected function _process_boolean_tree ($ operations_ary )
808808 {
809809 $ operation = array_shift ($ operations_ary );
810-
810+
811811 foreach ($ operations_ary AS &$ condition )
812812 {
813813 switch ($ condition [0 ])
814814 {
815815 case 'AND ' :
816816 case 'OR ' :
817-
817+
818818 $ condition = ' ( ' . $ this ->_process_boolean_tree ($ condition ) . ') ' ;
819-
819+
820820 break ;
821821 case 'NOT ' :
822-
822+
823823 $ condition = ' NOT ' . $ this ->_process_boolean_tree ($ condition );
824-
824+
825825 break ;
826-
826+
827827 default :
828-
828+
829829 switch (sizeof ($ condition ))
830830 {
831831 case 3 :
832-
832+
833833 // Typical 3 element clause with {left hand} {operator} {right hand}
834834 switch ($ condition [1 ])
835- {
835+ {
836836 case 'IN ' :
837837 case 'NOT_IN ' :
838-
838+
839839 // As this is used with an IN, assume it is a set of elements for sql_in_set()
840840 $ condition = $ this ->sql_in_set ($ condition [0 ], $ condition [2 ], $ condition [1 ] === 'NOT_IN ' , true );
841-
841+
842842 break ;
843-
843+
844844 default :
845-
845+
846846 $ condition = implode (' ' , $ condition );
847-
847+
848848 break ;
849849 }
850-
850+
851851 break ;
852-
852+
853853 case 5 :
854-
854+
855855 // Subquery with {left hand} {operator} {compare kind} {SELECT Kind } {Sub Query}
856-
856+
857857 $ condition = $ condition [0 ] . ' ' . $ condition [1 ] . ' ' . $ condition [2 ] . ' ( ' ;
858858 $ condition .= $ this ->sql_build_query ($ condition [3 ], $ condition [4 ]);
859859 $ condition .= ' ) ' ;
860-
860+
861861 break ;
862-
862+
863863 default :
864864 // This is an unpredicted clause setup. Just join all elements.
865865 $ condition = implode (' ' , $ condition );
866-
866+
867867 break ;
868868 }
869-
869+
870870 break ;
871871 }
872-
872+
873873 }
874-
874+
875875 if ($ operation === 'NOT ' )
876876 {
877877 $ operations_ary = implode ("" , $ operations_ary );
@@ -880,10 +880,10 @@ protected function _process_boolean_tree($operations_ary)
880880 {
881881 $ operations_ary = implode (" \n $ operation " , $ operations_ary );
882882 }
883-
883+
884884 return $ operations_ary ;
885885 }
886-
886+
887887
888888 /**
889889 * {@inheritDoc}
0 commit comments