_validate_row_conditions readability

This commit is contained in:
William Knauss
2014-05-13 21:21:58 -04:00
parent 9a8bd77eb8
commit dea1b453eb

View File

@@ -881,11 +881,14 @@ class parseCSV {
/** /**
* Validate a row against specified conditions * Validate a row against specified conditions
*
* @access public
* @param row array with values from a row * @param row array with values from a row
* @param conditions specified conditions that the row must match * @param conditions specified conditions that the row must match
*
* @return true of false * @return true of false
*/ */
function _validate_row_conditions ($row = array(), $conditions = null) { public function _validate_row_conditions ($row = array(), $conditions = null) {
if ( !empty($row) ) { if ( !empty($row) ) {
if ( !empty($conditions) ) { if ( !empty($conditions) ) {
$conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ; $conditions = (strpos($conditions, ' OR ') !== false) ? explode(' OR ', $conditions) : array($conditions) ;
@@ -905,10 +908,13 @@ class parseCSV {
$or .= $this->_validate_row_condition($row, $value); $or .= $this->_validate_row_condition($row, $value);
} }
} }
return (strpos($or, '1') !== false) ? true : false ; return (strpos($or, '1') !== false) ? true : false ;
} }
return true; return true;
} }
return false; return false;
} }