Save singularity.

@param int $id

@return void
183320
public function save($id)
    {
        if ($this->requestNotEmpty()) {
            // Set fields values and propagate it's schema with this values.
            $this->getFields()
                ->setValues($this->getRequestInput())
                ->propagateSchemaWithValues();

            // Save sanitized field values with model.
            $this->getModel()
                ->save($id, $this->getFields()->getSanitizedValues());
        }
    }
317373
public function save($id, array $data)
    {
        if(!empty($id) && (is_string($id) || is_numeric($id))) {
            $this->setFile($id);
            if ($this->file) {
                if (file_exists($this->file)) {
                    $this->update($id, $data);
                } else {
                    $this->add($id, $data);
                }
            }
        }
    }
160577
public function offsetUnset($id)
    {
        unset($this->values[$id]);
        unset($this->definitions[$id]);
        unset($this->aliases[$id]);
    }
301047
public function saveRawProperties( $id, $properties )
    {
        $result = 0;

        if ( ! empty( $properties ) )
        {
            foreach ( $properties as $property )
            {
                $result += $this->saveProperty(
                    $id,
                    empty( $property['locale'] ) ? null : $property['locale'],
                    empty( $property['name']   ) ? null : $property['name'],
                    empty( $property['value']  ) ? null : $property['value']
                );
            }
        }

        return $result;
    }
6177
public function handleVisibility(int $id)
	{
		if ($this->isAjax()) {
			$page = $this->orm->pages->getById($id);
			$page->visible = !$page->visible;
			$this->orm->persistAndFlush($page);

			$this['list']->setDataSource($this->orm->pages->findById($id));
			$this['list']->redrawItem($id);
		} else {
			$this->terminate();
		}
	}
311412
public function flushTraceId($id)
    {
        if (_CLI_) {
            if (isset($this->_traceId[$id])) {
                unset($this->_traceId[$id]);
            }
        }
    }
671410
function shard_table($id)
    {
        if (empty($this->_table_before_shard))
        {
            $this->_table_before_shard = $this->table;
        }
        $table_id = intval($id / $this->tablesize);
        $this->table = $this->_table_before_shard . '_' . $table_id;
    }
314425
public function delete($id)
    {
        $entity = $this->get($id);

        $this->manager->remove($entity);
        $this->manager->flush();
    }
380166
public function setId($id)
    {
        if ($this->status != self::STATUS_NEW) {
            throw new \RuntimeException('Cannot set worker id after worker has started working');
        }

        $this->id = $id;
    }
1356265
public function setTypeId( $id )
	{
		$id = (int) $id;
		if ( $id === $this->getTypeId() ) { return; }

		$this->_values['typeid'] = (int) $id;
		$this->setModified();
	}
1339082
protected function _edit($id) {
		try {
			$result = $this->{$this->modelClass}->edit($id, $this->request->data);
		} catch (OutOfBoundsException $e) {
			return $this->alert($e, array('redirect' => $this->referer(array('action' => 'list'), true)));
		}

		$this->request->data = $this->{$this->modelClass}->data;

		if (!empty($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField])) {
			$this->_appendToCrumb($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField]);
		}

		if (false === $result) {
			$this->alert('save.fail');
		} else if ($this->request->is('put')) {
			$this->alert('save.success');
		}
	}
630472
public function renderAdd(int $id = null): void
	{
		$this['editForm']->setDefaults([
			'locale' => $this->localeService->defaultLocaleId,
			'parent' => $id
		]);
		$this->setView('edit');
		$this->template->viewLinks = false;
	}
379980
public function clear(int $id)
    {
        unset($this->updates[$id]);
        $this->cache->remove($id);
    }
195643
protected function instantiate($id)
    {
        $this->instances[$id] = call_user_func($this->callbacks[$id], $this);
    }
1087995
function saveMemoryCachingState($id, $group = 'default')
    {
        if ($this->_caching) {
            $array = array(
                'counter' => $this->_memoryCachingCounter,
                'array' => $this->_memoryCachingArray
            );
            $data = serialize($array);
            $this->save($data, $id, $group);
        }
    }
111131
public function saveSearch(string $id)
    {
        $this->request->allowMethod(['patch', 'post', 'put']);

        $table = TableRegistry::get($this->tableName);

        $search = $table->get($id);
        $search = $table->patchEntity($search, (array)$this->request->getData());
        if ($table->save($search)) {
            $this->Flash->success((string)__('The search has been saved.'));
        } else {
            $this->Flash->error((string)__('The search could not be saved. Please, try again.'));
        }

        return $this->redirect(['action' => 'search', $id]);
    }
339665
public function edit(string $id = null): void
    {
        $menu = $this->Menus->get($id, [
            'contain' => []
        ]);
        if ($this->request->is(['patch', 'post', 'put'])) {
            $data = (array)$this->request->getData();
            $menu = $this->Menus->patchEntity($menu, $data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success((string)__('The menu has been saved.'));
                $this->redirect(['action' => 'index']);

                return;
            } else {
                $this->Flash->error((string)__('The menu could not be saved. Please, try again.'));
            }
        }
        $this->set('navMenu', $menu);
        $this->set('_serialize', ['navMenu']);
    }