src/Query/ReadQuery.php
/**
     * See if an item passes the 'where' clauses
     * @param VisitInfo $visitInfo
     * @return bool
     */
See if an item passes the 'where' clauses
@param VisitInfo $visitInfo
@return bool
See if an item passes the ' where ' clauses @param VisitInfo $visitInfo @return bool
public function itemPassesChecks(VisitInfo $visitInfo): bool
    {
        if (count($this->whereClauses) < 1) {
            return true;
        }
        $keepItem = 1;
        foreach ($this->whereClauses as $whereClause) {
            switch ($whereClause->getKey()) {
                case 'timestamp':
                    $compareValue = $visitInfo->getTimestamp();
                    break;
                case 'ip_hash':
                    $compareValue = $visitInfo->getIpHash();
                    break;
                case 'url':
                    $compareValue = $visitInfo->getUrl();
                    break;
                case 'referrer':
                    $compareValue = $visitInfo->getReferrer();
                    break;
                default:
                    $compareValue = null;
                    break;
            }
            if ($compareValue === null) {
                continue;
            }
            $valuePasses = $whereClause->valuePasses($compareValue);
            $keepItem = min($keepItem, (int)$valuePasses);
        }
        return ($keepItem === 1);
    }
public function itemPassesChecks ( VisitInfo $ visitInfo ) : bool { if ( count ( $ this -> whereClauses ) < 1 ) { return true ; } $ keepItem = 1 ; foreach ( $ this -> whereClauses as $ whereClause ) { switch ( $ whereClause -> getKey ( ) ) { case 'timestamp' : $ compareValue = $ visitInfo -> getTimestamp ( ) ; break ; case 'ip_hash' : $ compareValue = $ visitInfo -> getIpHash ( ) ; break ; case 'url' : $ compareValue = $ visitInfo -> getUrl ( ) ; break ; case 'referrer' : $ compareValue = $ visitInfo -> getReferrer ( ) ; break ; default : $ compareValue = null ; break ; } if ( $ compareValue === null ) { continue ; } $ valuePasses = $ whereClause -> valuePasses ( $ compareValue ) ; $ keepItem = min ( $ keepItem , ( int ) $ valuePasses ) ; } return ( $ keepItem === 1 ) ; }
See if an item passes the 'where' clauses
 @param VisitInfo $visitInfo
 @return bool
See if an item passes the ' where ' clauses @param VisitInfo $visitInfo @return bool
// Keep the item, if there are no where clauses // Only compare existing values // If at least one check fails, don't keep the item