Stores a data item.

@param \BearFramework\App\DataItem $item The data item to store.
@return void No value is returned.
@throws \Exception
@throws \BearFramework\App\Data\DataLockedException
182701
public function set(DataItem $item): void
    {
        $command = [
            'command' => 'set',
            'key' => $item->key,
            'body' => $item->value,
            'metadata.*' => ''
        ];
        $metadataAsArray = $item->metadata->toArray();
        foreach ($metadataAsArray as $name => $value) {
            $command['metadata.' . $name] = $value;
        }
        $this->execute([$command]);
    }
998388
public function add($item)
    {
        // Disallow items outside of original boundaries
        if (!in_array($item, $this->originalList)) {
            return;
        }
        if (!in_array($item, $this->currentList)) {
            $this->currentList[] = $item;
        }
    }
1342925
protected function processItem($item) {
        if($item instanceof \CharlotteDunois\Yasmin\Interfaces\RatelimitBucketInterface) {
            if($item->isBusy()) {
                $this->queue[] = $item;
                
                foreach($this->queue as $qitem) {
                    if(!($qitem instanceof \CharlotteDunois\Yasmin\Interfaces\RatelimitBucketInterface) || !$qitem->isBusy()) {
                        $this->processItem($qitem);
                        return;
                    }
                }
                
                return;
            }
            
            $item->setBusy(true);
            $buckItem = $this->extractFromBucket($item);
            
            if(!($buckItem instanceof \React\Promise\ExtendedPromiseInterface)) {
                $buckItem = \React\Promise\resolve($buckItem);
            }
            
            $buckItem->done(function ($req) use ($item) {
                $item->setBusy(false);
                
                if(!($req instanceof \CharlotteDunois\Yasmin\HTTP\APIRequest)) {
                    return;
                }
                
                $this->execute($req);
            }, array($this->client, 'handlePromiseRejection'));
        } else {
            if(!($item instanceof \CharlotteDunois\Yasmin\HTTP\APIRequest)) {
                return;
            }
            
            $this->execute($item);
        }
    }
731702
public synchronized void put(byte item)
   {
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "put", Byte.valueOf(item));

      checkValid();
      getCurrentByteBuffer(1).put(item);

      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "put");
   }
675772
public function add($item)
    {
        if ($item instanceof Hashable) {
            $this->items[$item->hashCode()] = $item;

            return;
        }

        $this->items[(string)$item] = $item;
    }
988088
public function add_item( $item ) {
		if ( is_array( $item ) ) {
			foreach ( $item as $single_item ) {
				$this->add_item( $single_item );
			}
		} else {
			$priority                   = $item->get_priority();
			$this->items[ $priority ][] = $item;
		}
	}
38545
public function writeItem($item)
    {
        $this->verifyHandle();

        if ($this->autoDetectHeader && !$this->header && is_array($item)) {
            $this->header = array_keys($item);
            $this->writeItem($this->header);
        }

        $this->csv->insertOne($item);
    }
802443
public function setDiscountOnItem(CartItem $item)
    {
        $this->appliedToCart = false;
        $item->code = $this->code;
        $item->coupon = $this;
    }
139168
public function set(string $name, $item): void
    {
        $this->payloadContainerItems->set($name, $item);
    }
477676
private function load(iterable $data, $item, $key, bool $flush, int &$flushCounter, int &$totalCounter): void
    {
        try {
            ($this->load)($data, $key, $this);
            $this->eventDispatcher->dispatch(new ItemEvent(EtlEvents::LOAD, $item, $key, $this));
        } catch (\Throwable $e) {
            /** @var ItemExceptionEvent $event */
            $event = $this->eventDispatcher->dispatch(new ItemExceptionEvent(EtlEvents::LOAD_EXCEPTION, $item, $key, $this, $e));
            if ($event->shouldThrowException()) {
                throw $e;
            }
            $flushCounter--;
            $totalCounter--;
        }

        if (true === $flush) {
            $this->flush($flushCounter, true);
        }
    }
73646
protected function updateItem(Model $item, $data)
    {
        $this->beforeAssignData($item, $data);
        $item->assign($data, null, $this->whitelistUpdate());
        $this->afterAssignData($item, $data);

        $this->beforeSave($item);
        $this->beforeUpdate($item);

        $success = $item->update();

        if ($success) {

            $this->afterUpdate($item);
            $this->afterSave($item);
        }

        return $success ? $item : null;
    }
1200790
public function set(CacheableInterface $item)
    {
        $this->provider->save($item->getHashKey(), $item->getDataForCache(), $item->getTtl());
    }
1117063
public function save(CacheItemInterface $item)
    {
        $metadata = $item->getMetadata();
        $metadata[ 'data' ] = $item->get();
        $metadata = serialize($metadata);

        $path = $this->path . $this->prefixKey . $item->getKey() . '.cache';

        if ( ! $fp = @fopen($path, 'wb')) {
            return false;
        }

        flock($fp, LOCK_EX);

        for ($result = $written = 0, $length = strlen($metadata); $written < $length; $written += $result) {
            if (($result = fwrite($fp, substr($metadata, $written))) === false) {
                break;
            }
        }

        flock($fp, LOCK_UN);
        fclose($fp);

        return (bool)is_int($result);
    }
678068
public function process(DOMElement $node, Item $item)
    {
        foreach ($this->keys as $key) {
            $item->setExtra($key, $this->getValue($node, $key));
        }
    }
54456
public function remove(Item $item): void
    {
        foreach ($this->list as $key => $itemToCheck) {
            if ($itemToCheck === $item) {
                unset($this->list[$key]);
                break;
            }
        }
    }
575164
public function writeItem($item)
    {
        if ($this->autoDetectHeader && $this->header === null) {
            $this->handleAutoDetectHeaders($item);
        }

        if (is_array($item)) {
            $keys = array_keys($item);
        } elseif ($this->header && is_object($item)) {
            $keys = $this->header;
        } else {
            throw new \InvalidArgumentException(sprintf(
                'Plum\PlumExcel\ExcelWriter currently only supports array items or objects if headers are set using '.
                'the setHeader() method. You have passed an item of type "%s" to writeItem().',
                gettype($item)
            ));
        }

        $column = 0;
        foreach ($keys as $key) {
            $value = Vale::get($item, $key);
            $this->excel->getActiveSheet()->setCellValueByColumnAndRow($column, $this->currentRow, $value);
            ++$column;
        }
        ++$this->currentRow;
    }
1327348
public function postLoad(Item $item, LifecycleEventArgs $event)
    {
        $type = $this->itemDefinitions->getConvertedType($item->getMimeType());
        $definition = $this->itemDefinitions->get($type);
        $repository = $event
            ->getEntityManager()
            ->getRepository($definition->getEntityClass());

        /** @var \UJM\ExoBundle\Entity\ItemType\AbstractItem $typeEntity */
        $typeEntity = $repository->findOneBy([
            'question' => $item,
        ]);

        if (!empty($typeEntity)) {
            $item->setInteraction($typeEntity);
        }
    }