Include Children

@param Content $content Translation

@return \League\Fractal\ItemResource|null
347048
public function includeChildren(Content $content)
    {
        if ($content->isChildrenLoaded()) {
            return $this->collection($content->children, new ContentTransformer()); // We don't want LAZY LOADING !
        }
        return null;
    }
369193
public function includeAuthor(Content $content)
    {
        $author = $content->author;
        return (!empty($author)) ? $this->item($author, new UserTransformer()) : null;
    }
148459
public function setContent($content)
    {
        if (!is_null($content)) {
            $content = (string) $content;
        }

        $this->content = $content;
        return $this;
    }
917575
public function getNodes($content)
    {
        $items = array();
        $document = $this->createDocumentFromXML($content);
        $nodes = $document->getElementsByTagName('item');
        if ($nodes->length) {
            foreach ($nodes as $node) {
                try {
                    $item = $this->create($node);
                    $items[] = $item;
                } catch (\Exception $e) {
                    throw new RuntimeException($e->getMessage());
                }
            }
        }

        return $items;
    }
449925
public function &setContent($content)
    {
        // Set element type by analyzing the element
        switch (true) {

            case ($content instanceof FormGroup):
                $this->type = 'group';
                break;

            case ($content instanceof ControlsCollectionInterface):
                $this->type = 'collection';
                break;

            case ($content instanceof AbstractForm):
                $this->type = 'control';
                break;

            case ($content instanceof AbstractHtml):
                $this->type = 'factory';
                break;

            default:
                $this->type = 'html';
        }

        $this->content = $content;

        return $content;
    }
811253
public function addContent(Content $content)
    {
        if ($content->getArea()->getTemplate()->getSlug() == $this->getTemplate()->getSlug()
            && trim(strip_tags($content->getContents(), '<img><input><button><iframe>'))) {
            $content->setArticle($this);
            $this->contents[] = $content;
        }

        return $this;
    }
380642
public function mapContent(Content $content)
    {
        return new FullTextData(
            [
                'id' => $content->versionInfo->contentInfo->id,
                'contentTypeId' => $content->versionInfo->contentInfo->contentTypeId,
                'sectionId' => $content->versionInfo->contentInfo->sectionId,
                'published' => $content->versionInfo->contentInfo->publicationDate,
                'values' => $this->getFullTextValues($content),
            ]
        );
    }
1129099
public function append($content)
    {
        $content = self::create($content);
        $newnodes = array();
        foreach ($this as $i => $node) {
            /** @var \DOMNode $node */
            foreach ($content as $newnode) {
                /** @var \DOMNode $newnode */
                $newnode = static::importNewnode($newnode, $node, $i);
                $node->appendChild($newnode);
                $newnodes[] = $newnode;
            }
        }
        $content->clear();
        $content->add($newnodes);
        return $this;
    }
929406
public function setContent($content)
    {
        if (!$json = json_encode($content)) {
            $this->setResponseCode(self::HTTP_INTERNAL_SERVER_ERROR);
            $json = json_encode(['status' => 'error', 'error_message' => json_last_error_msg()]);
        }

        $this->content = $json;

        return $this;
    }
250432
static function FirstChildOf (Content $content)
    {
        $provider = self::GetTreeProvider($content);
        if (!$provider)
        {
            return null;
        }
        $item = $provider->ItemByContent($content);
        return $provider->ContentByItem($provider->FirstChildOf($item));
    }
959308
public function setInnerHtml($content)
    {
        $content = self::create($content);
        foreach ($this as $node) {
            $node->nodeValue = '';
            foreach ($content as $newnode) {
                /** @var \DOMNode $node */
                /** @var \DOMNode $newnode */
                $newnode = static::importNewnode($newnode, $node);
                $node->appendChild($newnode);
            }
        }
        return $this;
    }
244484
public function setContent(Content $content)
    {
        $this->contentTypeName = $content->getType()->getName();
        $this->contentId = $content->getContentId();

        return parent::setContent($content);
    }
145395
private function isContentTypeExcluded(Content $content)
    {
        $contentType = $this->repository->sudo(function () use ($content) {
            $contentType = $this->contentTypeService->loadContentType($content->contentInfo->contentTypeId);

            return $contentType;
        });

        return !in_array($contentType->identifier, $this->options['included-content-types']);
    }
1021508
public function setContent($content)
    {
        if (is_array($content) || $content instanceof ArrayAccess || $content instanceof JsonSerializable) {
            $this->headers->add(['Content-Type' => 'application/json; charset=utf-8']);
            $content = json_encode($content, JSON_UNESCAPED_UNICODE);
        }

        parent::setContent($content);
        parent::setCharset('utf-8');

        return $this;
    }
46500
public function getChildren(Content $content, Language $language)
    {
        return $content->children()
            ->with(self::$loadRelations)
            ->where('published_at', '<=', Carbon::now())
            ->whereHas('routes', function ($query) use ($language) {
                $query->where('routes.is_active', true)
                    ->where('language_code', $language->code);
            })
            ->orderBy('is_promoted', 'DESC')
            ->orderBy('is_sticky', 'DESC')
            ->orderBy('weight', 'ASC')
            ->orderBy('published_at', 'DESC')
            ->paginate(option('general', 'default_page_size', 20));
    }
108622
public function setContent($content)
    {
        $app = App::getInstance();

        $text = new \FelixOnline\Core\Text();
        $text->setContent($content);
        $text->save();

        $this->setText1($text);

        return $this;
    }
507861
public function getManyNotPublishedChildren(Content $content, QueryBuilder $builder)
    {
        return $this->getManyNotPublishedFrom($content->children()->newQuery()->with('type')->getQuery(), $builder);
    }