@@ -757,30 +757,31 @@ function _fieldWhereClause(&$field, $value, &$use_where, $tableAlias=null){
757
757
}
758
758
759
759
/**
760
- * @brief A wrapper around the _where() method that optionally takes
761
- * a Dataface_Record object as a parameter. This produces just the
762
- * where clause of an SQL query.
763
- *
764
- * @param mixed $query Either an array of parameters or a Dataface_Record object
765
- * which will be used for its keys.
766
- * @param Boolean $merge Whether to merge the criteria with the object's
767
- * current query.
768
- * @return string The where clause e.g. "WHERE name='Steve' and age=29"
769
- * @since 2.0.3
770
- */
771
- public function where ($ query = null , $ merge =true ){
772
- if ( $ query instanceof Dataface_Record ){
773
- $ record = $ query ;
774
- $ keys = array_keys ($ record ->table ()->keys ());
775
- $ query = array ();
776
- foreach ($ keys as $ key ){
777
- $ query [$ key ] = "= " .$ this ->_serializer ->serialize ($ key , $ record ->val ($ key ));
778
- }
779
- } else if ( !isset ($ query ) ){
780
- $ query = array ();
760
+ * @brief A wrapper around the _where() method that optionally takes
761
+ * a Dataface_Record object as a parameter. This produces just the
762
+ * where clause of an SQL query.
763
+ *
764
+ * @param mixed $query Either an array of parameters or a Dataface_Record object
765
+ * which will be used for its keys.
766
+ * @param Boolean $merge Whether to merge the criteria with the object's
767
+ * current query.
768
+ * @return string The where clause e.g. "WHERE name='Steve' and age=29"
769
+ * @since 2.0.3
770
+ */
771
+ public function where ($ query = null , $ merge =true ){
772
+ if ( $ query instanceof Dataface_Record ){
773
+ $ record = $ query ;
774
+ $ keys = array_keys ($ record ->table ()->keys ());
775
+ $ query = array ();
776
+ foreach ($ keys as $ key ){
777
+ $ query [$ key ] = "= " .$ this ->_serializer ->serialize ($ key , $ record ->val ($ key ));
781
778
}
782
- return $ this ->_where ($ query , $ merge );
779
+ } else if ( !isset ($ query ) ){
780
+ $ query = array ();
783
781
}
782
+ return $ this ->_where ($ query , $ merge );
783
+ }
784
+
784
785
785
786
/**
786
787
* Returns the where clause for the sql query.
0 commit comments