public function set($models)
    {
        if ($models instanceof ActiveRecord) {
            $models = [$models];
        }

        $first = reset($models);
        if ($first === false) {
            return $this;
        }
        $this->first = $first;

        $this->formName = $first->formName();
        $this->model    = $this->setModel($first);
        $this->models   = $models;

        if ($this->checkConsistency && !$this->isConsistent()) {
            throw new InvalidValueException('Models are not objects of same class or not follow same operation');
        }

        return $this;
    }