From: eileen Date: Tue, 27 Aug 2013 07:24:28 +0000 (+1200) Subject: CRM-13294 tweaks to comments & code readability X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=06f48f9677445eeba03e2a0c322dc19111ebc341;p=civicrm-core.git CRM-13294 tweaks to comments & code readability --- diff --git a/CRM/Core/DAO.php b/CRM/Core/DAO.php index 1abc63a044..e263202706 100644 --- a/CRM/Core/DAO.php +++ b/CRM/Core/DAO.php @@ -1827,8 +1827,13 @@ EOS; * @todo a better solutution would be for the query object to apply these filters based on the * api supported format (but we don't want to risk breakage in alpha stage & query class is scary * @todo @time of writing only IN & NOT IN are supported for the array style syntax (as test is - * required to extend further & it may be the comments per above should be implemented - */ + * required to extend further & it may be the comments per above should be implemented. It may be + * preferable to not double-banger the return context next refactor of this - but keeping the attention + * in one place has some advantages as we try to extend this format + * + * @return NULL|string|array a string is returned if $returnSanitisedArray is not set, otherwise and Array or NULL + * depending on whether it is supported as yet + **/ public function createSQLFilter($fieldName, $filter, $type, $alias = NULL, $returnSanitisedArray = FALSE) { // http://issues.civicrm.org/jira/browse/CRM-9150 - stick with 'simple' operators for now // support for other syntaxes is discussed in ticket but being put off for now @@ -1842,6 +1847,9 @@ EOS; if(!$returnSanitisedArray) { return (sprintf('%s %s', $fieldName, $operator)); } + else{ + return NULL; // not yet implemented (tests required to implement) + } break; // ternary operators @@ -1853,6 +1861,9 @@ EOS; if(!$returnSanitisedArray) { return (sprintf('%s ' . $operator . ' "%s" AND "%s"', $fieldName, CRM_Core_DAO::escapeString($criteria[0]), CRM_Core_DAO::escapeString($criteria[1]))); } + else{ + return NULL; // not yet implemented (tests required to implement) + } break; // n-ary operators @@ -1877,6 +1888,9 @@ EOS; if(!$returnSanitisedArray) { return(sprintf('%s %s "%s"', $fieldName, $operator, CRM_Core_DAO::escapeString($criteria))); } + else{ + return NULL; // not yet implemented (tests required to implement) + } } } }