private function arrayFilter($value, $field, array $where, array $with)
    {
        if ($field == 'is_hidden' && $with['hidden'] === false && $value == 1) {
            return false;
        }
    
        foreach ($where as $expression) {
            if ($expression['field'] == $field) {
                switch ($expression['op']) {
                    case '==':
                        return ($value === $expression['value']);
                    case '>':
                        return ($value > $expression['value']);
                    case '>=':
                        return ($value >= $expression['value']);
                    case '<':
                        return ($value < $expression['value']);
                    case '<=':
                        return ($value <= $expression['value']);
                    case 'in':
                        return in_array($value, $expression['value']);
                    case '!=':
                        return ($value != $expression['value']);
                    default:
                        return ($value == $expression['value']);
                }
            }
        }
    
        return true;
    }
private function arrayFilter($value, $field, array $where, array $with)
    {
        if ($field == 'is_hidden' && $with['hidden'] === false && $value == 1) {
            return false;
        }
    
        foreach ($where as $expression) {
            if ($expression['field'] == $field) {
                switch ($expression['op']) {
                    case '==':
                        return ($value === $expression['value']);
                    case '>':
                        return ($value > $expression['value']);
                    case '>=':
                        return ($value >= $expression['value']);
                    case '<':
                        return ($value < $expression['value']);
                    case '<=':
                        return ($value <= $expression['value']);
                    case 'in':
                        return in_array($value, $expression['value']);
                    case '!=':
                        return ($value != $expression['value']);
                    default:
                        return ($value == $expression['value']);
                }
            }
        }
    
        return true;
    }
private function arrayFilter ( $ value , $ field , array $ where , array $ with ) { if ( $ field == 'is_hidden' && $ with [ 'hidden' ] === false && $ value == 1 ) { return false ; } foreach ( $ where as $ expression ) { if ( $ expression [ 'field' ] == $ field ) { switch ( $ expression [ 'op' ] ) { case '==' : return ( $ value === $ expression [ 'value' ] ) ; case '>' : return ( $ value > $ expression [ 'value' ] ) ; case '>=' : return ( $ value >= $ expression [ 'value' ] ) ; case '<' : return ( $ value < $ expression [ 'value' ] ) ; case '<=' : return ( $ value <= $ expression [ 'value' ] ) ; case 'in' : return in_array ( $ value , $ expression [ 'value' ] ) ; case '!=' : return ( $ value != $ expression [ 'value' ] ) ; default : return ( $ value == $ expression [ 'value' ] ) ; } } } return true ; }
Filter an array item based on the where expression.

@param string $value
@param string $field
@param array $where
@param array $with
@return boolean
Filter an array item based on the where expression .