src/Where.php
public function execute(array $row)
    {
        foreach ($this->where as $key => $value) {
            $columns = $value[ 'column' ];
            switch ($value[ 'type' ]) {
                case 'where':
                case 'isNull':
                case 'in':
                    $predicate = self::predicate($row[ $columns ], $value[ 'condition' ], $value[ 'value' ]);

                    break;
                case 'whereCallback':
                    $predicate = $value[ 'value' ]->execute($row);

                    break;
                case 'between':
                    $predicate = self::predicate($row[ $columns ], '>=', $value[ 'min' ]) && self::predicate($row[ $columns ], '<=', $value[ 'max' ]);

                    break;
                case 'regex':
                    $predicate = !empty($value[ 'not' ])
                        ? !preg_match($value[ 'value' ], $row[ $columns ])
                        : preg_match($value[ 'value' ], $row[ $columns ]);
                    $predicate &= self::predicate($row[ $columns ], '!==', null);

                    break;
            }

            if ($value[ 'type' ] !== 'regex') {
                $predicate = !empty($value[ 'not' ])
                    ? !$predicate
                    : $predicate;
            }

            if ($key == 0) {
                $output = $predicate;
            } elseif ($value[ 'bool' ] === 'and') {
                $output &= $predicate;
            } else {
                $output |= $predicate;
            }
        }

        return $output;
    }
public function execute(array $row)
    {
        foreach ($this->where as $key => $value) {
            $columns = $value[ 'column' ];
            switch ($value[ 'type' ]) {
                case 'where':
                case 'isNull':
                case 'in':
                    $predicate = self::predicate($row[ $columns ], $value[ 'condition' ], $value[ 'value' ]);

                    break;
                case 'whereCallback':
                    $predicate = $value[ 'value' ]->execute($row);

                    break;
                case 'between':
                    $predicate = self::predicate($row[ $columns ], '>=', $value[ 'min' ]) && self::predicate($row[ $columns ], '<=', $value[ 'max' ]);

                    break;
                case 'regex':
                    $predicate = !empty($value[ 'not' ])
                        ? !preg_match($value[ 'value' ], $row[ $columns ])
                        : preg_match($value[ 'value' ], $row[ $columns ]);
                    $predicate &= self::predicate($row[ $columns ], '!==', null);

                    break;
            }

            if ($value[ 'type' ] !== 'regex') {
                $predicate = !empty($value[ 'not' ])
                    ? !$predicate
                    : $predicate;
            }

            if ($key == 0) {
                $output = $predicate;
            } elseif ($value[ 'bool' ] === 'and') {
                $output &= $predicate;
            } else {
                $output |= $predicate;
            }
        }

        return $output;
    }
Retourne TRUE si la suite de condition enregistrée valide les champs du tableau.

@param array $row Tableau associatif de champ.

@return bool