Links page content (providing tree info) and content in database
@param PageContent $item
@param Content $content
487562
public function AttachContent($item, Content $content)
    {
        $item->SetContent($content);
        $item->Save();
        $content->SetPageContent($item);
        $content->Save();
    }
1328650
public function hasItemContent(core_kernel_classes_Resource $item, $lang = '')
    {
        if (is_null($item)) {
            return false;
        }

        if (empty($lang)) {
            $lang = $this->getSessionLg();
        }

        $itemContents = $item->getPropertyValuesByLg($this->itemContentProperty, $lang);
        return !$itemContents->isEmpty();
    }
121471
private function appendItem(\sb\RSS\Item $item)
    {

        $new_item = $this->createElement("item");

        foreach(get_object_vars($item) as $key=>$val){
            if($item->{$key} instanceof \sb\RSS\ItemEnclosure){
                $enclosure = $this->createElement('enclosure');
                foreach($item->{$key} as $n=>$v){
                    $enclosure->setAttribute($n, $v);
                }

                $new_item->appendChild($enclosure);
            }

            if($key == 'categories'){
                foreach($item->{$key} as $category){
                    $new_item->appendChild($this->createNode('category', $category));
                }
            }

            if(is_string($val) && !empty($val)){

                $new_item->appendChild($this->createNode($key, $val, $key == 'description'));
            }
        }

        if(empty($item->guid)){
            $new_item->appendChild($this->createNode('guid', $item->link));
        }

        $this->channel->appendChild($new_item);

    }
68327
private function resolvePathToContent(array $item)
    {
        if ($item['path'] === 'homepage') {
            $item['link'] = $this->app['url_generator']->generate('homepage');

            return $item;
        }

        // We have a mistakenly placed URL, allow it but log it.
        if (preg_match('#^(https?://|//)#i', $item['path'])) {
            $item['link'] = $item['path'];
            $this->app['logger.system']->error(
                Trans::__(
                    'Invalid menu path (%PATH%) set in menu.yml. Probably should be a link: instead!',
                    ['%PATH%' => $item['path']]
                ),
                ['event' => 'config']
            );

            return $item;
        }

        // Get a copy of the path minus trailing/leading slash
        $path = trim($item['path'], '/');

        // Pre-set our link in case the match() throws an exception
        $basePath = '';
        if ($request = $this->app['request_stack']->getCurrentRequest()) {
            $basePath = $request->getBasePath();
        }
        $item['link'] = $basePath . '/' . $path;

        try {
            // See if we have a 'content/id' or 'content/slug' path
            if (preg_match('#^([a-z0-9_-]+)/([a-z0-9_-]+)$#i', $path)) {
                // Determine if the provided path first matches any routes
                // that we have, this will catch any valid configured
                // contenttype slug and record combination, or throw a
                // ResourceNotFoundException exception otherwise
                $this->app['url_matcher']->match('/' . $path);

                // If we found a valid routing match then we're still here,
                // attempt to retrieve the actual record and use its values.
                $item = $this->populateItemFromRecord($item, $path);
            }
        } catch (ResourceNotFoundException $e) {
            $this->app['logger.system']->error(
                Trans::__(
                    'Invalid menu path (%PATH%) set in menu.yml. Does not match any configured contenttypes or routes.',
                    ['%PATH%' => $item['path']]
                ),
                ['event' => 'config']
            );
        } catch (MethodNotAllowedException $e) {
            // Route is probably a GET and we're currently in a POST
        }

        return $item;
    }
693290
public function addContent($content)
    {
        if ($content instanceof Page) {
            $this->addPage($content);
        }
        else {
            if ($content) {
                $this->addChild($content);
            }
            else {
                throw new Exception("Unknown content type.");
            }
        }
    }
1211676
public function removePageContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {
        $this->page_contents->removeElement($pageContents);
    }
678068
public function process(DOMElement $node, Item $item)
    {
        foreach ($this->keys as $key) {
            $item->setExtra($key, $this->getValue($node, $key));
        }
    }
125382
public function clearPageCache(CacheItemInterface $item = null)
    {
        // Use current item if not provided in arguments
        if (is_null($item)) {
            $item = $this->getCurrentItem();
        }

        // Current item might have returned null
        if (is_null($item)) {
            throw new PageCacheException(__METHOD__ . ' Page cache item can not be detected');
        }

        $this->getItemStorage()->delete($item);
    }
815855
public function addBlogContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {

        $this->addPageContent($pageContents);

        return $this;
    }
576003
private function _isLink($item): bool
	{
		if ($item === null) {
			return true;
		} elseif (is_array($item)) {
			return !is_array(current($item));
		} else {
			throw new \InvalidArgumentException('Cms menu items is wrong in config.neon');
		}
	}
1079161
private function setValue($item) : void
    {
        if (is_string($item)) {
            return;
        }
        $element = $item->getElement();
        $name = $element->name();
        if ($element instanceof File) {
            if (array_key_exists($name, $_FILES)) {
                $element->setValue($_FILES[$name]);
                $element->valueSuppliedByUser(true);
            }
        } elseif (array_key_exists($name, $_POST)) {
            if ($element instanceof Radio) {
                if ($_POST[$name] == $element->getValue()
                    || (is_array($_POST[$name])
                        && in_array($element->getValue(), $_POST[$name])
                    )
                ) {
                    $element->check();
                } else {
                    $element->check(false);
                }
            } else {
                $element->setValue($_POST[$name]);
            }
            $element->valueSuppliedByUser(true);
        } elseif ($element instanceof Radio) {
            $element->check(false);
        }
    }
30298
private function saveContentInCache($item, array $content)
    {
        if (null !== $this->cache && null !== $item) {
            $item->set($this->contentCache);
            $this->cache->save($item);
        }

        return $content;
    }
218699
public function moveContent($content, $type, $page)
    {
        $contenType = $this->contentType->findOneBy(array('type' => $type, 'content' => $content));

        $contenType->detach();
        $contenType->setType($page);
        $contenType->setFirst($this->contentType->findOneBy(array('type' => $page, 'back' => null)));

        $this->manager->persist($contenType);
        $this->manager->flush();
    }
337947
function (item, pageConfig) {
            var templateCfg = {
                classpath : item.template
            };
            var args = item.args || [];
            var extraArg = {};
            if (item.contentId) {
                extraArg.contents = this._getPlaceholderContents(pageConfig, item.contentId);
            }
            args.push(extraArg);

            templateCfg.args = args;
            if (item.module) {
                var module = this._rootModule.getPageModule(this.currentPageId, item.module);
                templateCfg.moduleCtrl = module;
                this._modulesInPage.push(module);
            }
            if (item.data) {
                templateCfg.data = item.data;
            }
            return templateCfg;
        }
275983
protected function renderSingleElementHTML(PageLayoutView $parentObject, $item)
    {
        $singleElementHTML = '';
        $unset = false;
        if (!isset($parentObject->tt_contentData['nextThree'][$item['uid']])) {
            $unset = true;
            $parentObject->tt_contentData['nextThree'][$item['uid']] = $item['uid'];
        }
        if (!$parentObject->tt_contentConfig['languageMode']) {
            $singleElementHTML .= '<div class="t3-page-ce-dragitem" id="' . StringUtility::getUniqueId() . '">';
        }
        $singleElementHTML .= $parentObject->tt_content_drawHeader(
            $item,
            $parentObject->tt_contentConfig['showInfo'] ? 15 : 5,
            $parentObject->defLangBinding,
            true,
            true
        );
        $singleElementHTML .= (!empty($item['_ORIG_uid']) ? '<div class="ver-element">' : '')
            . '<div class="t3-page-ce-body-inner t3-page-ce-body-inner-' . $item['CType'] . '">'
            . $parentObject->tt_content_drawItem($item)
            . '</div>'
            . (!empty($item['_ORIG_uid']) ? '</div>' : '');
        $singleElementHTML .= $this->tt_content_drawFooter($parentObject, $item);
        if (!$parentObject->tt_contentConfig['languageMode']) {
            $singleElementHTML .= '</div>';
        }
        if ($unset) {
            unset($parentObject->tt_contentData['nextThree'][$item['uid']]);
        }

        return $singleElementHTML;
    }
702082
public function renderContent($item)
    {
        $options = ArrayHelper::merge($this->contentOptions, ArrayHelper::getValue($item, 'contentOptions', []));

        $encode = ArrayHelper::getValue($options, 'encode', true);
        $content = $encode ? Html::encode($item['content']) : $item['content'];

        Html::addCssClass($options, 'content');
        if ($item['active']) {
            Html::addCssClass($options, 'active');
        }
        return Html::tag('div', $content, $options);
    }
140893
protected function htmlEntityEncode($item)
    {
        if (is_array($item)) {
            array_walk_recursive($item, function (&$value) {
                $value = htmlentities($value);
            });
        } else {
            $item = htmlentities($item);
        }

        return $item;
    }