sets the current model.

@param Model $model
481453
public function setModel(Model $model)
    {
        $this->model = $model;
        $this->fm = $this->model->loadFunctionMap();
    }
612064
protected function invalidate(Model $model): void
    {
        $key = $this->prefix . ":" . $model->getKey();
        if ($this->cacheRepository->has($key)) {
            $this->cacheRepository->forget($key);
        }
        $this->cacheRepository->forget("$this->prefix.:all");
    }
482233
def set_model(self, model):
        
        self._model = model
        for c in self.childItems:
            c.set_model(model)
1172768
public function link(Model $model) {
        $this->getRelation($this->getAlias(get_class($model)))->link($model);

        return $this;
    }
359988
public function afterDelete(Model $Model) {
		if ($this->settings[$Model->alias]['auto'] === false) {
			return;
		}
		if (!$Model->ShadowModel) {
			return;
		}
		if (isset($this->deleteUpdates[$Model->alias]) && !empty($this->deleteUpdates[$Model->alias])) {
			foreach ($this->deleteUpdates[$Model->alias] as $assocAlias => $assocIds) {
				$Model->{$assocAlias}->updateRevisions($assocIds);
			}
			unset($this->deleteUpdates[$Model->alias]);
		}
	}
619620
public function loadCurrent($model)
    {
        $model->_table[$this->short_name]->next();
        $model->data = $model->_table[$this->short_name]->current();
        $model->id = $model->data[$model->id_field];
    }
1327210
public function setModel(Model $model)
    {
        if (($content = $this->getContent()) instanceof WithModelInterface) {
            $content->setModel($model);
        }

        return $this;
    }
779150
def setModel(self, model):
        

        LOGGER.debug("> Setting '{0}' model.".format(model))

        if not model:
            return

        umbra.ui.views.Abstract_QTreeView.setModel(self, model)
684419
public function setModel(Model $model)
    {
        $this->model = $model;
        $this->class = get_class($model);

        return $this;
    }
839526
public function save(Model $model) {
        if ($model->isPrimaryKey($this->foreignKey)) {
            $model->save();
            $this->parent->{$this->localKey} = $model->{$this->foreignKey};
            $this->parent->save();
            return $this;
        }
        $model->{$this->foreignKey} = $this->parent->{$this->localKey};
        $model->save();
        return $this;
    }
1321128
public function setCurrentUser(Model $Model, $user = null) {
		if (!empty($user)) {
			return $this->_user = $user;
		}

		$this->_user = AuthComponent::user();

		if (empty($this->_user) && !empty($Model->id)) {
			$findMethod = 'findBy' . Inflector::classify($Model->primaryKey);
			$this->_user = $Model->{$findMethod}($Model->id);
		}

		return $this->_user;
	}
202914
public function clearReusableForModel(Model $model) {
        $values = $this->_reusable;
        if(is_null($values)) {
            return;
        }
        $className = get_class($model);
        foreach($values as $key=>$value) {
            if(strpos($key, $className)===0) {
                unset($values[$key]);
            }
        }
        $this->_reusable = $values;
    }
606646
public function setModel(FrameModel $frameModel)
    {
        $this->modelId = null;
        $this->model   = $frameModel;
        return $this;
    }
120578
public static function import(Model $model)
    {
        Utils\Utils::arrayPathSet(self::$models, self::getPath($model), $model);
    }
248408
public void setModel(TableModel model)
    {
// Column 3 and 4: (Scroll Pane Headings)
        if (m_model != null)
            m_model.removeTableModelListener(this);
        m_model = model;
        if (model != null)
            model.addTableModelListener(this);
        this.setupPanel();      // setup a new panel
    }
451913
public function save(Model $model)
    {
        $database = $model->getSourceDB();
        $pkey = $model->getID();

        if ($database === null || $database !== $this->db)
            $this->insert($model);
        else
            $this->update($model);

        return $this;
    }
1245057
public function setTargetModel($model)
    {
        if (is_string($model)) {
            $model = $this->modelFactory()->get($model);
        }

        if (!$model instanceof ModelInterface) {
            throw new InvalidArgumentException(
                sprintf(
                    'The model must be an instance of "%s"',
                    ModelInterface::class
                )
            );
        }

        $this->targetModel = $model;

        return $this;
    }