{@inheritdoc}

@return $this|self
422444
public function associate(string $role, string $permission, string $rule = AllowRule::class): PermissionManager
    {
        if (!$this->hasRole($role)) {
            throw new RoleException("Undefined role '{$role}'");
        }

        if (!$this->rules->has($rule)) {
            throw new PermissionException("Undefined rule '{$rule}'");
        }

        $this->permissions[$role][$permission] = $rule;

        return $this;
    }
160366
public function with($scope)
	{
		$scope = is_array($scope) ? $scope : [$scope];

		$this->scopes = array_merge($this->scopes, $scope);

		return $this;
	}
1191460
public function andWhere(...$conditions) : self
    {
        $this->conditionalQueryBuilder->andWhere(
            ...$this->createConditionExpressions($conditions)
        );

        return $this;
    }
1314616
public function overload(): self
    {
        $this->loader = new Loader($this->files);
        $this->loader->load();

        return $this;
    }
566715
public function reset()
    {
        $reflection = new \ReflectionClass(static::class);
        foreach ($reflection->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
            if (!$property->isStatic()) {
                $this->{$property->getName()} = null;
            }
        }
        return $this;
    }
512222
public function expression($value) : self
    {
        $this->requiresCurrentField(__METHOD__);
        $this->expr[$this->currentField] = $this->ensureArray($value);

        return $this;
    }
578271
public function to($values): self
    {
        $values = is_string($values) || is_integer($values) ? func_get_args() : $values;

        foreach ($values as $value) {
            if (! in_array($value, $this->to)) {
                $this->to[] = $value;
            }
        }

        return $this;
    }
379118
public static function init(): self
    {
        if (self::$instance == null) {
            self::$instance = new self();
        }

        return self::$instance;
    }
1208833
public function having($conditions): self
    {
        if ($conditions[0] instanceof Closure) {
            $this->addClauseCondClosure('having', 'AND', $conditions[0]);

            return $this;
        }
        $this->having[] = ['and', $conditions];

        return $this;
    }
620831
public function exclude(...$keys): self {
        if ($keys) {
            foreach ($keys as $key) {
                $this->_excludeKeys[$key] = 1;
            }
        } else {
            $this->_excludeKeys = [];
        }
        return $this;
    }
376414
public function fromModelTable(): self
    {
        $this->from(
            $this->quoteSingleIdentifier($this->getTableName()),
            $this->quoteSingleIdentifier($this->getAlias())
        );

        return $this;
    }
629547
public function where($conditions): self
    {
        if ($conditions[0] instanceof Closure) {
            $this->addClauseCondClosure('where', 'AND', $conditions[0]);

            return $this;
        }
        $this->where[] = ['and', $conditions];

        return $this;
    }
103842
public function set(CheckerInterface $checker): self
    {
        $this->checkers[$checker->getId()] = $checker;

        return $this;
    }
219153
public function init() {
        $options = $this->getServiceLocator()->get('search.options');
        $this->setOptions($options);
        $this->driverName = $options['driver'];
        $this->setDriverEscaper($this->getServiceLocator()->get($this->driverList[$this->driverName]));
        
        return $this;
    }
403125
public function scope(...$scopes): self
    {
        $this->scopes = \array_merge($this->scopes, $scopes);

        return $this;
    }
161009
public function setType($type): self
    {
        if ($type instanceof Type) {
            $this->setIndex($type->getIndex()->getName());
            $type = $type->getName();
        }
        $this->_metadata['_type'] = $type;

        return $this;
    }
942598
public function clear(): self
    {
        $driver = $this->getDriver();
        $driver->clear();
        if ($this->hasEventListeners('clear')) {
            $this->dispatchEvent('clear');
        }
        return $this;
    }