src/Neutrino/Repositories/Repository.php
protected function paramsToCriteria(array $params = null, array $orders = null, $limit = null, $offset = null)
    {
        $criteria = [];

        if (!empty($params)) {
            $clauses = [];

            foreach ($params as $key => $value) {
                if (is_array($value)) {
                    if(isset($value['operator']) && array_key_exists('value', $value)){
                        if(is_array($value['value'])){
                            $clauses[] = "$key {$value['operator']} ({{$key}:array})";
                        } else {
                            $clauses[] = "$key {$value['operator']} :$key:";
                        }
                        $params[$key] = $value['value'];
                    } else {
                        $clauses[] = "$key IN ({{$key}:array})";
                    }
                } elseif (is_string($value)) {
                    $clauses[] = "$key LIKE :$key:";
                } else {
                    $clauses[] = "$key = :$key:";
                }
            }

            $criteria = [
                implode(' AND ', $clauses),
                'bind' => $params
            ];
        }

        if (!empty($orders)) {
            $_orders = [];
            foreach ($orders as $key => $order) {
                if (is_int($key)) {
                    $key   = $order;
                    $order = 'ASC';
                }
                $_orders[] = "$key $order";
            }

            $criteria['order'] = implode(', ', $_orders);
        }

        if (isset($limit)) {
            $criteria['limit'] = $limit;
        }

        if (isset($offset)) {
            $criteria['offset'] = $offset;
        }

        return $criteria;
    }
protected function paramsToCriteria(array $params = null, array $orders = null, $limit = null, $offset = null)
    {
        $criteria = [];

        if (!empty($params)) {
            $clauses = [];

            foreach ($params as $key => $value) {
                if (is_array($value)) {
                    if(isset($value['operator']) && array_key_exists('value', $value)){
                        if(is_array($value['value'])){
                            $clauses[] = "$key {$value['operator']} ({{$key}:array})";
                        } else {
                            $clauses[] = "$key {$value['operator']} :$key:";
                        }
                        $params[$key] = $value['value'];
                    } else {
                        $clauses[] = "$key IN ({{$key}:array})";
                    }
                } elseif (is_string($value)) {
                    $clauses[] = "$key LIKE :$key:";
                } else {
                    $clauses[] = "$key = :$key:";
                }
            }

            $criteria = [
                implode(' AND ', $clauses),
                'bind' => $params
            ];
        }

        if (!empty($orders)) {
            $_orders = [];
            foreach ($orders as $key => $order) {
                if (is_int($key)) {
                    $key   = $order;
                    $order = 'ASC';
                }
                $_orders[] = "$key $order";
            }

            $criteria['order'] = implode(', ', $_orders);
        }

        if (isset($limit)) {
            $criteria['limit'] = $limit;
        }

        if (isset($offset)) {
            $criteria['offset'] = $offset;
        }

        return $criteria;
    }
@param array      $params
@param array|null $orders
@param null       $limit
@param null       $offset

@return array