Edits an entity, changing title and/or description. Maintains Id.

@param integer $ID
@param string $NewTitle
@param string $NewDescription
191507
function edit($ID, $NewTitle = null, $NewDescription = null)
	{
		$Data = array ();

		if ($NewTitle !== null)
			$Data ['Title'] = $NewTitle;

		if ($NewDescription !== null)
			$Data ['Description'] = $NewDescription;

        return $this->{$this->type ()}->editData ( $Data, "ID=?", $ID ) == 1;
	}
1326194
def _update_id(record, new_id):
    
    old_id = record.id
    record.id = new_id

    # At least for FASTA, record ID starts the description
    record.description = re.sub('^' + re.escape(old_id), new_id, record.description)
    return record
785438
public function addDescription($title, $description, $titleAttribs = [], $descAttribs = [])
    {
        $this->addTitle($title, $titleAttribs)
            ->addDesc($description, $descAttribs);

        return $this;
    }
265453
protected function addDescription(\DOMElement $node, DescriptorAbstract $element)
    {
        $node->appendChild(new \DOMElement('long-description'))
            ->appendChild(new \DOMText($element->getDescription()));
    }
911518
@Override
	public void defineEntityReplacementText(String entity, String value) {
		if (processDocDecl) {
			throw new IllegalStateException("Entity replacement text may not be defined with DOCTYPE processing enabled.");
		}
		if (reader == null) {
			throw new IllegalStateException("Entity replacement text must be defined after setInput()");
		}
		if (documentEntities == null) {
			documentEntities = new HashMap<String, char[]>();
		}
		documentEntities.put(entity, value.toCharArray());
	}
714751
public function setTabTitle($name, $new_name)
    {
        if ($this->hasTab($name)) {
            $this->tabs[$name][static::TITLE] = $new_name;
        }
    }
944569
public function update(string $key, $oldValue, $newValue, AbstractElement $element)
	{
		if (!isset($this->index[$key])) {
			throw new MissingAttrIndexException("Attribute index \"$key\" is not defined.");
		}

		$id = $element->getId();

		if (isset($this->index[$key][$oldValue][$id])) {
			unset($this->index[$key][$oldValue][$id]);
		} else {
			throw new MissingElementException("Old value of \"$id\" is not indexed.");
		}

		$this->index[$key][$newValue][$id] = $element;
	}
4407
public function update_category($updateid, $newparent, $newname, $newinfo, $newinfoformat = FORMAT_HTML,
            $idnumber = null, $redirect = true) {
        global $CFG, $DB;
        if (empty($newname)) {
            print_error('categorynamecantbeblank', 'question');
        }

        // Get the record we are updating.
        $oldcat = $DB->get_record('question_categories', array('id' => $updateid));
        $lastcategoryinthiscontext = question_is_only_child_of_top_category_in_context($updateid);

        if (!empty($newparent) && !$lastcategoryinthiscontext) {
            list($parentid, $tocontextid) = explode(',', $newparent);
        } else {
            $parentid = $oldcat->parent;
            $tocontextid = $oldcat->contextid;
        }

        // Check permissions.
        $fromcontext = context::instance_by_id($oldcat->contextid);
        require_capability('moodle/question:managecategory', $fromcontext);

        // If moving to another context, check permissions some more, and confirm contextid,stamp uniqueness.
        $newstamprequired = false;
        if ($oldcat->contextid != $tocontextid) {
            $tocontext = context::instance_by_id($tocontextid);
            require_capability('moodle/question:managecategory', $tocontext);

            // Confirm stamp uniqueness in the new context. If the stamp already exists, generate a new one.
            if ($DB->record_exists('question_categories', array('contextid' => $tocontextid, 'stamp' => $oldcat->stamp))) {
                $newstamprequired = true;
            }
        }

        if ((string) $idnumber === '') {
            $idnumber = null;
        } else if (!empty($tocontextid)) {
            // While this check already exists in the form validation, this is a backstop preventing unnecessary errors.
            if ($DB->record_exists('question_categories',
                    ['idnumber' => $idnumber, 'contextid' => $tocontextid])) {
                $idnumber = null;
            }
        }

        // Update the category record.
        $cat = new stdClass();
        $cat->id = $updateid;
        $cat->name = $newname;
        $cat->info = $newinfo;
        $cat->infoformat = $newinfoformat;
        $cat->parent = $parentid;
        $cat->contextid = $tocontextid;
        if ($idnumber) {
            $cat->idnumber = $idnumber;
        }
        if ($newstamprequired) {
            $cat->stamp = make_unique_id_code();
        }
        $DB->update_record('question_categories', $cat);

        // Log the update of this category.
        $event = \core\event\question_category_updated::create_from_question_category_instance($cat);
        $event->trigger();

        // If the category name has changed, rename any random questions in that category.
        if ($oldcat->name != $cat->name) {
            $where = "qtype = 'random' AND category = ? AND " . $DB->sql_compare_text('questiontext') . " = ?";

            $randomqtype = question_bank::get_qtype('random');
            $randomqname = $randomqtype->question_name($cat, false);
            $DB->set_field_select('question', 'name', $randomqname, $where, array($cat->id, '0'));

            $randomqname = $randomqtype->question_name($cat, true);
            $DB->set_field_select('question', 'name', $randomqname, $where, array($cat->id, '1'));
        }

        if ($oldcat->contextid != $tocontextid) {
            // Moving to a new context. Must move files belonging to questions.
            question_move_category_to_context($cat->id, $oldcat->contextid, $tocontextid);
        }

        // Cat param depends on the context id, so update it.
        $this->pageurl->param('cat', $updateid . ',' . $tocontextid);
        if ($redirect) {
            redirect($this->pageurl); // Always redirect after successful action.
        }
    }
1285168
public function edit($id, DomainForm $form): void
    {
        $model = $this->repository->get($id);
        $model->edit($form->name, $form->alias, $form->url);
        $this->repository->save($model);
    }
598652
@Programmatic // for use by fixtures
    public SummernoteEditorToDoItem newToDo(
            final String description,
            final SummernoteEditorToDoItem.Category category,
            final SummernoteEditorToDoItem.Subcategory subcategory,
            final String userName,
            final LocalDate dueBy,
            final BigDecimal cost,
            final BigDecimal previousCost) {
        final SummernoteEditorToDoItem toDoItem = container.newTransientInstance(SummernoteEditorToDoItem.class);
        toDoItem.setDescription(description);
        toDoItem.setCategory(category);
        toDoItem.setSubcategory(subcategory);
        toDoItem.setOwnedBy(userName);
        toDoItem.setDueBy(dueBy);
        toDoItem.setCost(cost);
        toDoItem.setPreviousCost(previousCost);

        container.persist(toDoItem);
        container.flush();

        return toDoItem;
    }
531982
public function addNewInstance($object, FieldDescriptionInterface $fieldDescription)
    {
        $instance = $fieldDescription->getAssociationAdmin()->getNewInstance();
        $mapping = $fieldDescription->getAssociationMapping();

        $method = sprintf('add%s', Inflector::classify($mapping['fieldName']));

        if (!method_exists($object, $method)) {
            $method = rtrim($method, 's');

            if (!method_exists($object, $method)) {
                $method = sprintf('add%s', Inflector::classify(Inflector::singularize($mapping['fieldName'])));

                if (!method_exists($object, $method)) {
                    throw new \RuntimeException(
                        sprintf('Please add a method %s in the %s class!', $method, ClassUtils::getClass($object))
                    );
                }
            }
        }

        $object->$method($instance);
    }
484894
public function updateSection($id, $name, $identifier)
    {
        $query = $this->dbHandler->createUpdateQuery();
        $query->update(
            $this->dbHandler->quoteTable('ezsection')
        )->set(
            $this->dbHandler->quoteColumn('name'),
            $query->bindValue($name)
        )->set(
            $this->dbHandler->quoteColumn('identifier'),
            $query->bindValue($identifier)
        )->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('id'),
                $query->bindValue($id, null, \PDO::PARAM_INT)
            )
        );

        $query->prepare()->execute();
    }
648737
function( newTag )
		{
			// If it's already correct exit here.
			if ( this.getName() == newTag )
				return;

			var doc = this.getDocument();

			// Create the new node.
			var newNode = new CKEDITOR.dom.element( newTag, doc );

			// Copy all attributes.
			this.copyAttributes( newNode );

			// Move children to the new node.
			this.moveChildren( newNode );

			// Replace the node.
			this.getParent() && this.$.parentNode.replaceChild( newNode.$, this.$ );
			newNode.$[ 'data-cke-expando' ] = this.$[ 'data-cke-expando' ];
			this.$ = newNode.$;
		}
191357
public function addInnerDescription(\Librinfo\VarietiesBundle\Entity\VarietyDescriptionInner $innerDescription)
    {
        $this->inner_descriptions[] = $innerDescription;

        return $this;
    }
310335
public Result<Void> addDescription(AuthzTrans trans, String ns, String type,
			String instance, String action, String description) {
		try {
			getSession(trans).execute(UPDATE_SP + TABLE + " SET description = '" 
				+ description + "' WHERE ns = '" + ns + "' AND type = '" + type + "'"
				+ "AND instance = '" + instance + "' AND action = '" + action + "';");
		} catch (DriverException | APIException | IOException e) {
			reportPerhapsReset(trans,e);
			return Result.err(Result.ERR_Backend, CassAccess.ERR_ACCESS_MSG);
		}

		Data data = new Data();
		data.ns=ns;
		data.type=type;
		data.instance=instance;
		data.action=action;
		wasModified(trans, CRUD.update, data, "Added description " + description + " to permission " 
				+ data.encode(), null );
		return Result.ok();
	}
1268661
static public function updateInitialLanguage( $objectID, $newInitialLanguageID )
    {
        $object = eZContentObject::fetch( $objectID );
        $language = eZContentLanguage::fetch( $newInitialLanguageID );
        if ( $language and !$language->attribute( 'disabled' ) )
        {
            $object->setAttribute( 'initial_language_id', $newInitialLanguageID );
            $objectName = $object->name( false, $language->attribute( 'locale' ) );
            $object->setAttribute( 'name', $objectName );
            $object->store();

            if ( $object->isAlwaysAvailable() )
            {
                $object->setAlwaysAvailableLanguageID( $newInitialLanguageID );
            }

            $nodes = $object->assignedNodes();
            foreach ( $nodes as $node )
            {
                $node->updateSubTreePath();
            }
        }

        eZContentCacheManager::clearContentCacheIfNeeded( $objectID );

        return array( 'status' => true );
    }
806774
public function edit($modal = "no", $ids = "") {
		if (URequest::isAjax ()) {
			$instance = $this->getModelInstance ( $ids, false );
			$instance->_new = false;
			$this->_edit ( $instance, $modal );
		} else {
			$this->jquery->execAtLast ( "$('._edit[data-ajax={$ids}]').trigger('click');" );
			$this->index ();
		}
	}