public function getWhere()
    {
        $where = $this->where;

        if (! $where) {
            return [];
        }

        foreach ($where['$or'] as &$and) {
            if (isset($and['$and']) && count($and['$and']) === 1) {
                $and = reset($and['$and']);
            }

            if (isset($and['$or']) && count($and['$or']) === 1) {
                $and = reset($and['$or']);
            }
        }

        if (count($where['$or']) === 1) {
            $where = reset($where['$or']);
        }

        return $where;
    }