Load data from database

@param Content  $content  Content
@param Language $language Current language

@return $this|mixed
348736
public function handle(Content $content, Language $language): Response
    {
        $children = $this->repo->getChildren($content, $language)->setPath($this->request->url());
        $files    = $content->files;

        ContentHandler::buildBreadcrumbs($content, $language);

        return response()->view(
            'gzero-cms::contents.category',
            [
                'content'   => $content,
                'images'    => $files->filter(
                    function ($file) {
                        return $file->type->name === 'image';
                    }
                ),
                'documents' => $files->filter(
                    function ($file) {
                        return $file->type->name === 'document';
                    }
                ),
                'children'  => $children
            ]
        );
    }
42727
public function setContent($content)
    {
        $this->content = null;
        if ($content === null) {
            return;
        }

        if (TypeHandling::isSimpleType(gettype($content)) && !is_array($content)) {
            $this->content = (string)$content;
        }

        if (is_resource($content)) {
            $this->content = $content;
        }

        return $this;
    }
1090539
public function loadGroupsOfContentType($contentTypeId)
    {
        $contentType = $this->contentTypeService->loadContentType($contentTypeId, Language::ALL);

        return new Values\ContentTypeGroupRefList(
            $contentType,
            $contentType->getContentTypeGroups()
        );
    }
638684
public static function fromContentObject( eZContentObject $contentObject )
    {
        $set = new ezpContentFieldSet();
        $languages = $contentObject->availableLanguages();
        foreach( $languages as $language )
        {
            $set->childrenFieldSets[$language] =
                ezpContentFieldSet::fromDataMap( $contentObject->fetchDataMap( false, $language ) );
        }

        // this sequence is REALLY ugly
        reset( $languages );
        $set->setActiveLanguage( current( $languages ) );

        return $set;
    }
1069884
public function getContent($lang = null) {
		if (is_null($lang)) $lang = $this->_language;

		if ($this->_content == null) {
			$file = $this->_language_path . $lang . '/i18n.php';
			$this->_content = $this->_loadFile($file, false);
		}

		return $this->_content;
	}
4217
public function loadAllLanguagesData()
    {
        try {
            return $this->innerGateway->loadAllLanguagesData();
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
643261
protected function loadLanguageFile($file, $format)
    {
        if (is_file($file)) {
            $this->load($file, $format);

            $loaded = $this->config['language.loaded'];

            $loaded[] = $file;

            $this->config->set('language.loaded', $loaded);
        }

        return $this;
    }
1091876
private function resolveContentEditData(
        Content $content,
        string $languageCode,
        ContentType $contentType
    ): ContentUpdateData {
        $contentUpdateMapper = new ContentUpdateMapper();

        return $contentUpdateMapper->mapToFormData($content, [
            'languageCode' => $languageCode,
            'contentType' => $contentType,
        ]);
    }
724684
public function setLanguage(\Core\Entity\Language $language = null) {
        $this->language = $language;

        return $this;
    }
1106182
public function updateLanguage(Language $language)
    {
        $query = $this->dbHandler->createUpdateQuery();
        $query->update($this->dbHandler->quoteTable('ezcontent_language'));

        $this->setCommonLanguageColumns($query, $language);

        $query->where(
            $query->expr->eq(
                $this->dbHandler->quoteColumn('id'),
                $query->bindValue($language->id, null, \PDO::PARAM_INT)
            )
        );

        $query->prepare()->execute();
    }
224910
public function SetContent(Content $content)
    {
        $this->texts = array();
        $wordings = ContentWording::Schema()->FetchByContent(false, $content);
        foreach($wordings as $wording)
        {
            $prefix = Str::Replace('-', '.', $content->GetType());
            $this->texts[$prefix . '.' . $wording->GetPlaceholder()] = $wording->GetText();
        }
    }
1162194
function addLanguage($languageKey, $content) {
        //If the langage exists and it's an array, add to it instead of replacing it.
        if (is_array($this->getLanguage($languageKey))) {
            $this->languages[$languageKey][] = $content[0];
            return;
        }
        $this->languages[$languageKey] = $content;
        return $this;
    }
297113
public function loadContentInVersion($contentId, $versionNumber, Request $request)
    {
        $languages = Language::ALL;
        if ($request->query->has('languages')) {
            $languages = explode(',', $request->query->get('languages'));
        }

        $content = $this->repository->getContentService()->loadContent(
            $contentId,
            $languages,
            $versionNumber
        );
        $contentType = $this->repository->getContentTypeService()->loadContentType(
            $content->getVersionInfo()->getContentInfo()->contentTypeId
        );

        $versionValue = new Values\Version(
            $content,
            $contentType,
            $this->repository->getContentService()->loadRelations($content->getVersionInfo()),
            $request->getPathInfo()
        );

        if ($content->contentInfo->mainLocationId === null || $content->versionInfo->status === VersionInfo::STATUS_DRAFT) {
            return $versionValue;
        }

        return new Values\CachedValue(
            $versionValue,
            array('locationId' => $content->contentInfo->mainLocationId)
        );
    }
1374462
public function loadExternalFieldData(Content $content)
    {
        foreach ($content->fields as $field) {
            $this->storageHandler->getFieldData($content->versionInfo, $field);
        }
    }
691325
private function resolveContentEditForm(
        ContentUpdateData $contentUpdate,
        string $languageCode,
        Content $content
    ): FormInterface {
        return $this->formFactory->create(
            ContentEditType::class,
            $contentUpdate,
            [
                'languageCode' => $languageCode,
                'mainLanguageCode' => $content->contentInfo->mainLanguageCode,
                'drafts_enabled' => true,
            ]
        );
    }
22828
public function setLanguage(\Innova\LexiconBundle\Entity\Language $language = null)
    {
        $this->language = $language;

        return $this;
    }
1245570
public function load($id)
    {
        $language = $this->cache->get('ez-language-' . $id);
        if ($language === null) {
            $language = $this->innerHandler->load($id);
            $this->storeCache([$language]);
        }

        return $language;
    }