@param ContentFile $contentFile

@return ContentItem
482854
protected function buildContentItem(ContentFile $contentFile)
    {
        $data = [
            'uri'         => $contentFile->getUri(),
            'title'       => $contentFile->getTitle(),
            'date'        => $contentFile->getDate(),
            'type'        => $contentFile->getType(),
            'content'     => $contentFile->getContent(),
            'template'    => $contentFile->getTemplate(),
            'description' => $contentFile->getDescription(),
            'seoTitle'    => $contentFile->getSeoTitle(),
            'excerpt'     => $contentFile->getExcerpt(),
            'isIndex'     => $contentFile->isIndex(),
        ];

        $contentItem = ContentItem::fromArray($data);

        foreach ($contentFile->getMetadata() as $k => $v) {
            $contentItem->setMeta($k, $v);
        }

        foreach ($contentFile->getTerms() as $term) {
            $contentItem->addTerm($term);
        }

        return $contentItem;
    }
561603
public function getContent($infile) {
    $contents = $this->smarty->fetch($infile);

    if ($this->filetype === 'php') {
      $this->beautifier->setInputString($contents);
      $this->beautifier->process();
      $contents = $this->beautifier->get();
      // The beautifier isn't as beautiful as one would hope. Here's some extra string fudging.
      $replacements = [
        ') ,' => '),',
        "\n  }\n}\n" => "\n  }\n\n}\n",
        '=> true,' => '=> TRUE,',
        '=> false,' => '=> FALSE,',
      ];
      $contents = str_replace(array_keys($replacements), array_values($replacements), $contents);
      $contents = preg_replace('#(\s*)\\/\\*\\*#', "\n\$1/**", $contents);
      // Convert old array syntax to new square brackets
      $contents = CRM_Core_CodeGen_Util_ArraySyntaxConverter::convert($contents);
    }

    return $contents;
  }
920128
public function getContent() {
        $content = file_get_contents($this->fileSource);
        foreach ($this->rules as $rule)
            $content = $rule->apply($content);
        return new TextFileContent($content);
    }
505293
public static function createFile($file, $content = '')
    {
        $folder = dirname($file);
        if (!is_dir($folder)) {
            self::createFolder($folder);
        }

        file_put_contents($file, $content);
    }
159610
public function setTemplateFile(string $templateFile)
    {
        if (!$templateFile) {
            return $this;
        }
        $this->templateFile = (string) $templateFile;

        return $this;
    }
1126371
public function getFileContents($sFile)
    {
        $sContents = null;
        if (file_exists($sFile) && is_readable($sFile)) {
            $sContents = file_get_contents($sFile);
        }

        return $sContents;
    }
1075604
public function setXMLFile($XMLFile){
		if (file_exists($XMLFile)){
			$this->XMLFile = $XMLFile;
			$this->fileOK = true;
		}else{
			$this->fileOK = false;
		}
		return $this->fileOK;
	}
697344
public function addContent(\Coral\ContentBundle\Entity\Content $contents)
    {
        $this->contents[] = $contents;

        return $this;
    }
124000
public function getContent(?string $contentType = null, ?string $contentKey = null): Core\ViewResource
    {
        return new Core\ViewResource($this->_getContent(@$this->content[$contentType][$contentKey]));
    }
934081
public function setContainerIDFile(string $containerIDFile)
    {
        $this->containerIDFile = $containerIDFile;

        $this->hostConfig = array_merge($this->hostConfig, ['ContainerIDFile' => $containerIDFile]);

        return $this;
    }
1309223
public function startCreatingContent(string $contentType): ContentUpdateItemPage
    {
        $this->rightMenu->clickButton('Create');

        $contentTypePicker = ElementFactory::createElement($this->context, ContentTypePicker::ELEMENT_NAME);
        $contentTypePicker->select($contentType);

        $contentUpdatePage = PageObjectFactory::createPage($this->context, ContentUpdateItemPage::PAGE_NAME, $contentType);
        $contentUpdatePage->verifyIsLoaded();

        return $contentUpdatePage;
    }
323496
public function setId(string $value) : ContentItem
    {

        if ($this->data['id'] !== $value) {
            $this->data['id'] = $value;
            $this->setModified('id');
        }

        return $this;
    }
625104
public function getAssetFile($assetFile)
    {
        $assetFileId = Utilities::getEntityId(
            $assetFile,
            'WindowsAzure\MediaServices\Models\AssetFile'
        );

        return AssetFile::createFromOptions(
            $this->_getEntity("Files('{$assetFileId}')")
        );
    }
668271
public function setFileBody(string $fileBody, string $contentType='')
  {
    # Clear the normal body
    $this->setBody('');

    # Set content type
    if (!empty($contentType)) {
      $this->setContentType($contentType);
    }

    # Set the filename
    $this->fileBody = $fileBody;

    return $this;
  }
571375
public function setContentLanguages($contentLanguages)
    {
        $fileVersion = $this->getFileVersion();

        foreach ($contentLanguages as $locale) {
            $contentLanguage = new FileVersionContentLanguage();
            $contentLanguage->setFileVersion($fileVersion);
            $contentLanguage->setLocale($locale);
            if (!$fileVersion->getContentLanguages()->contains($contentLanguage)) {
                $fileVersion->addContentLanguage($contentLanguage);
            }
        }

        return $this;
    }
653602
public function setContentType(ContentType $contentType)
    {
        $this->contentTypeName = $contentType->getName();
        $this->contentTypeId = null;

        return parent::setContentType($contentType);
    }
441035
protected function _getContentList()
    {
        if (!$this->_oContentList) {
            $this->_oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
        }

        return $this->_oContentList;
    }