<p>Update ItemInList with Item Place.</p>
@param <T> item place type
@param <I> item type
@param pReqVars additional param
@param pItemPlace Item Place
@param pItemType EShopItemType
@throws Exception - an exception
489819
public final <T extends AItemPlace<I, ?>, I extends IHasIdLongVersionName> void updateForItemPlace(
    final Map<String, Object> pReqVars, final T pItemPlace, final EShopItemType pItemType) throws Exception {
    String whereStr = "where ITSTYPE=" + pItemType.ordinal() + " and ITEMID=" + pItemPlace.getItem().getItsId();
    ItemInList itemInList = getSrvOrm().retrieveEntityWithConditions(pReqVars, ItemInList.class, whereStr);
    if (itemInList == null) {
      itemInList = createItemInList(pReqVars, pItemPlace.getItem());
    }
    itemInList.setAvailableQuantity(pItemPlace.getItsQuantity());
    if (itemInList.getIsNew()) {
      getSrvOrm().insertEntity(pReqVars, itemInList);
    } else {
      getSrvOrm().updateEntity(pReqVars, itemInList);
    }
  }
475503
public static function update_inplace_editable($component, $itemtype, $itemid, $value) {
        global $PAGE;
        // Validate and normalize parameters.
        $params = self::validate_parameters(self::update_inplace_editable_parameters(),
                      array('component' => $component, 'itemtype' => $itemtype, 'itemid' => $itemid, 'value' => $value));
        if (!$functionname = component_callback_exists($component, 'inplace_editable')) {
            throw new \moodle_exception('inplaceeditableerror');
        }
        $tmpl = component_callback($params['component'], 'inplace_editable',
            array($params['itemtype'], $params['itemid'], $params['value']));
        if (!$tmpl || !($tmpl instanceof \core\output\inplace_editable)) {
            throw new \moodle_exception('inplaceeditableerror');
        }
        return $tmpl->export_for_template($PAGE->get_renderer('core'));
    }
718412
@Override
  public void add(MtasDataItem<T1, T2> newItem) throws IOException {
    if (newItem instanceof MtasDataItemBasic) {
      MtasDataItemBasic<T1, T2> newTypedItem = (MtasDataItemBasic<T1, T2>) newItem;
      this.valueSum = operations.add11(this.valueSum, newTypedItem.valueSum);
      this.valueN += newTypedItem.valueN;
      recomputeComparableSortValue = true;
    } else {
      throw new IOException("can only add MtasDataItemBasic");
    }
  }
520265
public void updateChildrenTypes(ModelNode address, List<ModelNode> modelNodes) {

        TreeItem  rootItem = findTreeItem(tree, address);
        addChildrenTypes((ModelTreeItem) rootItem, modelNodes);

    }
795456
@Override
  public final T process(final Map<String, Object> pReqVars,
    final T pEntity, final IRequestData pRequestData) throws Exception {
    SeSeller ses = findSeSeller.find(pReqVars, pRequestData.getUserName());
    pEntity.setSeller(ses);
    if (pEntity.getIsNew()) {
      this.srvOrm.insertEntity(pReqVars, pEntity);
      pEntity.setIsNew(false);
    } else {
      T entOld = this.srvOrm.retrieveEntity(pReqVars, pEntity);
      if (!entOld.getSeller().getItsId().getItsId()
        .equals(pEntity.getSeller().getItsId().getItsId())) {
        throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
        "Attempt to update smb. else's entity: user/entity/EID/SEOLDID/SEID - "
          + pRequestData.getUserName() + "/" + pEntity.getClass()
           .getSimpleName() + "/" + pEntity.getItsId() + "/" + entOld
            .getSeller().getItsId().getItsId() + "/" + pEntity.getSeller()
              .getItsId().getItsId());
      }
      this.srvOrm.updateEntity(pReqVars, pEntity);
    }
    return pEntity;
  }
580743
public void updateAssociations(JMFType type) {
    super.updateAssociations(type);
    itemType.updateAssociations(((JSRepeated)type).getItemType());
  }
63688
private void diffRecursively(CatalogType prevType, CatalogType newType)
    {
        assert(prevType != null) : "Null previous object found in catalog diff traversal.";
        assert(newType != null) : "Null new object found in catalog diff traversal";

        Object materializerValue = null;
        // Consider shifting into the strict more required within materialized view definitions.
        if (prevType instanceof Table) {
            // Under normal circumstances, it's highly unlikely that another (nested?) table will
            // appear in the details of a materialized view table. So, when it does (!?), be sure to
            // complain -- and don't let it throw off the accounting of the strict diff mode.
            // That is, don't set the local "materializerValue".
            if (m_inStrictMatViewDiffMode) {
                // Maybe this should log or append to m_errors?
                System.out.println("ERROR: unexpected nesting of a Table in CatalogDiffEngine.");
            } else {
                materializerValue = prevType.getField("materializer");
                if (materializerValue != null) {
                    // This table is a materialized view, so the changes to it and its children are
                    // strictly limited, e.g. no adding/dropping columns.
                    // In a future development, such changes may be allowed, but they may be implemented
                    // differently (get different catalog commands), such as through a wholesale drop/add
                    // of the entire view and materialized table definitions.
                    // The non-null local "materializerValue" is a reminder to pop out of this mode
                    // before returning from this level of the recursion.
                    m_inStrictMatViewDiffMode = true;
                    if (m_triggeredVerbosity) {
                        System.out.println("DEBUG VERBOSE diffRecursively entering strict mat view mode");
                    }
                }
            }
        }

        // diff local fields
        for (String field : prevType.getFields()) {
            // this field is (or was) set at runtime, so ignore it for diff purposes
            if (field.equals("isUp"))
            {
                continue;
            }

            boolean verbosityTriggeredHere = false;
            if (( ! m_triggeredVerbosity) && field.equals(m_triggerForVerbosity)) {
                System.out.println("DEBUG VERBOSE diffRecursively verbosity (triggered by field '" + field + "' is ON");
                verbosityTriggeredHere = true;
                m_triggeredVerbosity = true;
            }
            // check if the types are different
            // options are: both null => same
            //              one null and one not => different
            //              both not null => check Object.equals()
            Object prevValue = prevType.getField(field);
            Object newValue = newType.getField(field);
            if ((prevValue == null) != (newValue == null)) {
                if (m_triggeredVerbosity) {
                    if (prevValue == null) {
                        System.out.println("DEBUG VERBOSE diffRecursively found new '" + field + "' only.");
                    } else {
                        System.out.println("DEBUG VERBOSE diffRecursively found prev '" + field + "' only.");
                    }
                }
                writeModification(newType, prevType, field);
            }
            // if they're both not null (above/below ifs implies this)
            else if (prevValue != null) {
                // if comparing CatalogTypes (both must be same)
                if (prevValue instanceof CatalogType) {
                    assert(newValue instanceof CatalogType);
                    String prevPath = ((CatalogType) prevValue).getCatalogPath();
                    String newPath = ((CatalogType) newValue).getCatalogPath();
                    if (prevPath.compareTo(newPath) != 0) {
                        if (m_triggeredVerbosity) {
                            int padWidth = StringUtils.indexOfDifference(prevPath, newPath);
                            String pad = StringUtils.repeat(" ", padWidth);
                            System.out.println("DEBUG VERBOSE diffRecursively found a path change to '" + field + "':");
                            System.out.println("DEBUG VERBOSE prevPath=" + prevPath);
                            System.out.println("DEBUG VERBOSE diff at->" + pad + "^ position:" + padWidth);
                            System.out.println("DEBUG VERBOSE  newPath=" + newPath);
                        }
                        writeModification(newType, prevType, field);
                    }
                }
                // if scalar types
                else {
                    if (prevValue.equals(newValue) == false) {
                        if (m_triggeredVerbosity) {
                            System.out.println("DEBUG VERBOSE diffRecursively found a scalar change to '" + field + "':");
                            System.out.println("DEBUG VERBOSE diffRecursively prev: " + prevValue);
                            System.out.println("DEBUG VERBOSE diffRecursively new : " + newValue);
                            if (field.equals("plannodetree")) {
                                try {
                                    System.out.println("DEBUG VERBOSE where prev plannodetree expands to: " +
                                            new String(CompressionService.decodeBase64AndDecompressToBytes((String)prevValue), "UTF-8"));
                                }
                                catch (Exception e) {
                                    try {
                                        System.out.println("DEBUG VERBOSE where prev plannodetree expands to: " +
                                                new String(Encoder.decodeBase64AndDecompressToBytes((String)prevValue), "UTF-8"));
                                    }
                                    catch (UnsupportedEncodingException e2) {}
                                }
                                try {
                                    System.out.println("DEBUG VERBOSE where new plannodetree expands to: " +
                                            new String(CompressionService.decodeBase64AndDecompressToBytes((String)newValue), "UTF-8"));
                                }
                                catch (Exception e) {
                                    try {
                                        System.out.println("DEBUG VERBOSE where new plannodetree expands to: " +
                                                new String(Encoder.decodeBase64AndDecompressToBytes((String)newValue), "UTF-8"));
                                    }
                                    catch (UnsupportedEncodingException e2) {}
                                }
                            }
                        }
                        writeModification(newType, prevType, field);
                    }
                }
            }
            if (verbosityTriggeredHere) {
                System.out.println("DEBUG VERBOSE diffRecursively verbosity is OFF");
                m_triggeredVerbosity = false;
            }
        }

        // recurse
        for (String field : prevType.getChildCollections()) {
            boolean verbosityTriggeredHere = false;
            if (field.equals(m_triggerForVerbosity)) {
                System.out.println("DEBUG VERBOSE diffRecursively verbosity ON");
                m_triggeredVerbosity = true;
                verbosityTriggeredHere = true;
            }
            CatalogMap<? extends CatalogType> prevMap = prevType.getCollection(field);
            CatalogMap<? extends CatalogType> newMap = newType.getCollection(field);
            getCommandsToDiff(field, prevMap, newMap);
            if (verbosityTriggeredHere) {
                System.out.println("DEBUG VERBOSE diffRecursively verbosity OFF");
                m_triggeredVerbosity = false;
            }
        }

        if (materializerValue != null) {
            // Just getting back from recursing into a materialized view table,
            // so drop the strictness required only in that context.
            // It's safe to assume that the prior mode to which this must pop back is the non-strict
            // mode because nesting of table definitions is unpossible AND we guarded against its
            // potential side effects, above, anyway.
            m_inStrictMatViewDiffMode = false;
        }

    }
751451
@Override
  public final AItemSpecifics<T, ID> process(
    final Map<String, Object> pReqVars,
      final AItemSpecifics<T, ID> pEntity,
        final IRequestData pRequestData) throws Exception {
    //Beige-ORM refresh:
    pEntity.setSpecifics(getSrvOrm().retrieveEntity(pReqVars,
      pEntity.getSpecifics()));
    if (pEntity.getSpecifics().getChooseableSpecificsType() != null) {
      pEntity.setLongValue2(pEntity.getSpecifics().getChooseableSpecificsType()
        .getItsId());
      pEntity.setStringValue2(pEntity.getSpecifics()
        .getChooseableSpecificsType().getItsName());
    }
    if (pEntity.getIsNew()) {
      //only complex ID
      getSrvOrm().insertEntity(pReqVars, pEntity);
    } else {
      getSrvOrm().updateEntity(pReqVars, pEntity);
    }
    return pEntity;
  }
894519
public void addItem(String term, Integer offsetStart, Integer offsetEnd,
      Integer posIncr, BytesRef payload, Integer flags) {
    if (!closed) {
      tokenNumber++;
      MtasUpdateRequestProcessorResultItem item = new MtasUpdateRequestProcessorResultItem(
          term, offsetStart, offsetEnd, posIncr, payload, flags);
      try {
        objectOutputStream.writeObject(item);
        objectOutputStream.reset();
        objectOutputStream.flush();
      } catch (IOException e) {
        forceCloseAndDelete();
        log.debug(e);
      }
    }
  }
913160
protected void updateApp(String itemId) {

        I_CmsOuTreeType foundType = null;
        for (I_CmsOuTreeType type : m_app.getTreeTypeProvider().getTreeTypes()) {
            if (itemId.equals(type.getId())) {
                foundType = type;
                break;
            }
        }
        if (foundType != null) {
            m_app.update(m_parentOu, foundType, null);
            return;
        }
        m_app.update(itemId, CmsOuTreeType.OU, null, "");
    }
511139
void insert(Suffix<T, S> suffix, ActivePoint<T, S> activePoint) {
        Object item = suffix.getEndItem();
        Object nextItem = getItemAt(activePoint.getLength());
        if (item.equals(nextItem)) {
            activePoint.incrementLength();
        } else {
            split(suffix, activePoint);
            suffix.decrement();
            activePoint.updateAfterInsert(suffix);

            if (suffix.isEmpty()) {
            }
            else
                tree.insert(suffix);
        }
    }
467462
@Override
  public final SeGoodsSpecifics process(final Map<String, Object> pReqVars,
    final SeGoodsSpecifics pEntity,
      final IRequestData pRequestData) throws Exception {
    SeSeller ses = findSeSeller.find(pReqVars, pRequestData.getUserName());
    pEntity.setSeller(ses);
    pEntity.setSpecifics(getSrvOrm().retrieveEntity(pReqVars,
      pEntity.getSpecifics()));
    if (pEntity.getSpecifics().getChooseableSpecificsType() != null) {
      pEntity.setLongValue2(pEntity.getSpecifics().getChooseableSpecificsType()
        .getItsId());
      pEntity.setStringValue2(pEntity.getSpecifics()
        .getChooseableSpecificsType().getItsName());
    }
    if (pEntity.getIsNew()) {
      this.srvOrm.insertEntity(pReqVars, pEntity);
      pEntity.setIsNew(false);
    } else {
      SeGoodsSpecifics entOld = this.srvOrm.retrieveEntity(pReqVars, pEntity);
      if (!entOld.getSeller().getItsId().getItsId()
        .equals(pEntity.getSeller().getItsId().getItsId())) {
        throw new ExceptionWithCode(ExceptionWithCode.FORBIDDEN,
        "Attempt to update smb. else's entity: user/entity/EID/SEOLDID/SEID - "
          + pRequestData.getUserName() + "/" + pEntity.getClass()
           .getSimpleName() + "/" + pEntity.getItsId() + "/" + entOld
            .getSeller().getItsId().getItsId() + "/" + pEntity.getSeller()
              .getItsId().getItsId());
      }
      this.srvOrm.updateEntity(pReqVars, pEntity);
    }
    return pEntity;
  }
1124262
public function itemUpdateListingType($item_id, $listing_type)
    {
        // TODO: Tests
        $response = $this->getGuzzleClient()
            ->post(
                '/items/' . $item_id . '/listing_type',
                array_merge(
                    $this->setQuery(),
                    $this->setBodyArray(['id' => $listing_type])
                )
            );

        return $this->serializer->deserialize(
            $response->getBody()->getContents(),
            Item::class,
            'json'
        );
    }
606218
def add_itemprop(itemprop)
      properties = Itemprop.parse(itemprop, @page_url)
      properties.each { |name, value| (@properties[name] ||= []) << value }
    end
1335930
protected function SetShippingTypeForArticle(TShopBasketArticle &$oItem, TdbShopShippingType &$oShippingType)
    {
        $iCurrentPos = $this->getItemPointer();
        $this->GoToStart();
        $bFound = false;
        while (!$bFound && ($oExistingItem = &$this->Next())) {
            /** @var $oExistingItem TShopBasketArticle */
            if ($oExistingItem->IsSameAs($oItem)) {
                $bFound = true;
            }
        }
        if ($bFound) {
            $oExistingItem->SetActingShippingType($oShippingType);
        }
        $this->setItemPointer($iCurrentPos);
    }
1047724
private <T extends NameBearer> void addItem(T item, Map<String, T> items, String typeName) {
		String itemName = item.getName();
		if (items.containsKey(itemName)) {
			throw new FuzzerException(name + ": '" + itemName + "' already present in " + typeName);
		}
		items.put(itemName, item);
	}
990181
private function reindex($navItemPageId, $placeholderVar, $prevId)
    {
        $index = 0;
        $datas = self::originalFind()->andWhere(['nav_item_page_id' => $navItemPageId, 'placeholder_var' => $placeholderVar, 'prev_id' => $prevId])->orderBy(['sort_index' => SORT_ASC, 'timestamp_create' => SORT_DESC])->all();
        foreach ($datas as $item) {
            Yii::$app->db->createCommand()->update(self::tableName(), ['sort_index' => $index], ['id' => $item->id])->execute();
            ++$index;
        }
    }