Распечатка одного пункта
@param $item
966755
private function printItem($item)
    {
        $htmlOptions = ['class' => 'dd-item'];
        $htmlOptions['data-id'] = !empty($item['id']) ? $item['id'] : '';

        echo Html::beginTag('li', $htmlOptions);

        echo Html::tag('div', '', ['class' => 'dd-handle']);
        echo Html::tag('div', $item['name'], ['class' => 'dd-content']);

        echo Html::beginTag('div', ['class' => 'dd-edit-panel']);
        echo Html::input('text', null, $item['name'],
            ['class' => 'dd-input-name', 'placeholder' => $this->getPlaceholderForName()]);

        echo Html::beginTag('div', ['class' => 'btn-group']);
        echo Html::button(Yii::t('voskobovich/nestedsets', 'Save'), [
            'data-action' => 'save',
            'class' => 'btn btn-success btn-sm',
        ]);
        echo Html::a(Yii::t('voskobovich/nestedsets', 'Advanced editing'), $item['update-url'], [
            'data-action' => 'advanced-editing',
            'class' => 'btn btn-default btn-sm',
            'target' => '_blank'
        ]);
        echo Html::button(Yii::t('voskobovich/nestedsets', 'Delete'), [
            'data-action' => 'delete',
            'class' => 'btn btn-danger btn-sm'
        ]);
        echo Html::endTag('div');

        echo Html::endTag('div');

        if (isset($item['children']) && count($item['children'])) {
            $this->printLevel($item['children']);
        }

        echo Html::endTag('li');
    }
1043036
public function set($index, $item)
    {
        $this->offsetSet($index, $this->parser->text($item));
    }
530302
public function offsetSet($offset, $item)
	{
		if ($offset === null)
		{
			$this->_data[] = $item;
			$this->_total = count($this->_data);
		}
		else
		{
			$this->_data[$offset] = $item;
		}
	}
988412
public function doLog( common_log_Item $item)
    {

        if (is_null($this->resource)) {
        	$this->resource  = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
        	socket_set_nonblock($this->resource);
        }
        if ($this->resource !== false) {
        	$message = json_encode(array(
        		's' => $item->getSeverity(),
        		'd' => $item->getDescription(),
        		'p' => $this->prefix,
        		't' => $item->getTags(),
        		'f' => $item->getCallerFile(),
        		'l' => $item->getCallerLine(),
        		'b' => $item->getBacktrace()
        	));
        	@socket_sendto($this->resource, $message, strlen($message), 0, $this->host, $this->port);
        	//ignore errors, socket might already be closed because php is shutting down
        }

    }
630019
protected function removeItem($item)
    {
        if (is_string($item)) {
            $item = $this->findItem($item);
        }

        echo "    > removing $item->name ...";
        $time = microtime(true);
        $this->authManager->remove($item);
        echo ' done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
    }
678068
public function process(DOMElement $node, Item $item)
    {
        foreach ($this->keys as $key) {
            $item->setExtra($key, $this->getValue($node, $key));
        }
    }
1302268
public function add($item)
    {
        if ($item instanceof ItemInterface) {
            $this->items[] = $item;
        } else {
            $this->items[] = new MulticardsItem($item);
        }
    }
585688
public function addItem($item)
	{
		if( ! $item instanceof Model )
		{
			$item = new $this->defaultModel($item);
		}

		$this->data[] = $item;
	}
1212553
protected function setFound($item, $item2)
    {
        if (isset($this->missing[$item])) {
            unset($this->missing[$item][$item2]);
            if (empty($this->missing[$item])) {
                unset($this->missing[$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);
        }
    }
83120
public function removeItem(GridItem $item)
    {
        foreach ($this->rowItems as $rowItem) {
            if ($rowItem->getItem()->getUuid() === $item->getUuid()) {
                $this->rowItems->removeElement($rowItem);
                break;
            }
        }
    }
1238379
public function removeStyle(Item $item)
    {
        $item->setIntro(preg_replace('/(<[^>]+) style=".*?"/i', '$1', $item->getIntro()));
        $item->setContent(preg_replace('/(<[^>]+) style=".*?"/i', '$1', $item->getContent()));

        return $item;
    }
964989
public function addItem($item)
    {
        if ($part = $this->getElements()->last()) {
            $part->addElement($item);
        } else {
            $this->addBody($item);
        }

        return $this;
    }
996732
protected function checkType($item)
    {
        $type = $this->getItemType($item);
        if (! $this->type) {
            $this->type = $type;

            return true;
        }

        if ($this->type != $type) {
            return false;
        }

        return true;
    }
1199085
public function setItem(Item $item)
    {
        if ($this->item !== $item) {
            $this->item = $item->addGenre($this);
        }

        return $this;
    }
1038729
public function remove( $item )
	{
		$index	= $this->getIndex( $item );
		unset( $this->list[$index] );
		return $this->write();
	}
1133747
protected function persist(Item $item)
    {
        $this->em->persist($item);
        foreach ($item->getNames() as $name) {
            $this->em->persist($name);
        }
        foreach ($item->getSources() as $source) {
            $this->em->persist($source);
        }
    }