Loads system languages with filtering applied.

@param \eZ\Publish\API\Repository\Values\Content\Content $content

@return array
322852
public function loadContentLanguages(Content $content): array
    {
        $contentLanguages = $content->versionInfo->languageCodes;

        $filter = function (Language $language) use ($contentLanguages) {
            return $language->enabled && in_array($language->languageCode, $contentLanguages, true);
        };

        $languagesByCode = [];

        foreach (array_filter($this->languageService->loadLanguages(), $filter) as $language) {
            $languagesByCode[$language->languageCode] = $language;
        }

        $saLanguages = [];

        foreach ($this->siteAccessLanguages as $languageCode) {
            if (!isset($languagesByCode[$languageCode])) {
                continue;
            }

            $saLanguages[] = $languagesByCode[$languageCode];
            unset($languagesByCode[$languageCode]);
        }

        return array_merge($saLanguages, array_values($languagesByCode));
    }
1260616
public function parse($content)
    {
        $set = null;
        if (strpos($content, '@ORM') === false) {
            return $set;
        }

        if (preg_match(self::PATTERN, $content, $matches)) {
            $set[] = [$matches[1], $matches[2]];
        }



        return $set;
    }
720332
protected function getEOL($content)
    {
        static $eols = [
            "\r\n",
            "\n",
            "\r",
        ];
        foreach($eols as $eol)
        {
            if(strpos($content, $eol))
            {
                return $eol;
            }
        }
        return PHP_EOL;
    }
521415
public function getContentLanguages()
    {
        $contentLanguages = [];
        /** @var FileVersionContentLanguage $contentLanguage */
        foreach ($this->getFileVersion()->getContentLanguages() as $contentLanguage) {
            $contentLanguages[] = $contentLanguage->getLocale();
        }

        return $contentLanguages;
    }
495101
private function loadFromExtensions($content)
    {
        foreach ($content as $namespace => $values) {
            if (in_array($namespace, ['imports', 'parameters'])) {
                continue;
            }

            if (!is_array($values)) {
                $values = [];
            }

            $this->configCollection->add($namespace, $values);
        }
    }
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']);
    }
1136321
public static function toArray($content)
	{
		$doc = new DomDocument('1.0', 'UTF-8');
		$doc->loadXML($content,LIBXML_COMPACT | LIBXML_NOBLANKS | LIBXML_NOCDATA);
		$result = array();
		self::parseToArray($doc->documentElement,$result);
		return $result;
	}
1109804
protected function parseContent($content) {
        if(is_bool($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        if (!$content) {
            return;
        }
        if (is_string($content)) {
            $this->addLanguage($this->language, $content);
            return;
        }
        foreach($content as $key => $data) {
            if (!empty($data[0]['sys']['linkType'])) {
                foreach($data as $link) {
                    $this->addLink($link['id'], $link['linkType'], $key);
                }
            } else {
                if (is_numeric($key)) {
                    $this->addLanguage($this->language, [$data]);
                } else {
                    $this->addLanguage($key, $data);
                }
            }
        }
    }
926972
public function parse($content)
    {
        if (!$content) {
            return [];
        }

        if (strpos($content, '@validator') === false) {
            return[];
        }


        $validatorSet = [];
        if (preg_match_all(self::ANNOTATION_PATTERN, $content, $matches)) {

            $typeBoolean = new InterpreterTypeBoolean();
            // simplify the matches and return only the parameter list
            $set = [];
            foreach ($matches[1] as $validator) {
                // if there is no validator name why even bother
                if (preg_match(self::VALIDATOR_NAME_PATTERN, $validator, $match)) {
                    $set[self::INDEX_INTERFACE] = $match[1];
                } else {
                    continue;
                }

                if (preg_match(self::VALIDATOR_OPERATOR_PATTERN, $validator, $match)) {
                    $set[self::INDEX_OPERATOR] = $match[1];
                } else {
                    $set[self::INDEX_OPERATOR] = self::DEFAULT_OPERATOR;
                }

                if (preg_match(self::VALIDATOR_MANDATORY_PATTERN, $validator, $match)) {
                    $set[self::INDEX_MANDATORY] = $typeBoolean->execute($match[1]);
                } else {
                    $set[self::INDEX_MANDATORY] = self::DEFAULT_MANDATORY;
                }

                if (preg_match(self::VALIDATOR_EXPECTATION_PATTERN, $validator, $match)) {
                    $set[self::INDEX_EXPECTED] = $typeBoolean->execute($match[1]);
                } else {
                    $set[self::INDEX_EXPECTED] = self::DEFAULT_EXPECTATION;
                }

                // add the set
                if ($set) {
                    array_push($validatorSet, $set);
                }
            }
        }

        return $validatorSet;
    }
982089
protected function parse($content)
    {
        $result = array();
        foreach ($this->parsers as $parser) {
            $nodes = $parser->getNodes($content);
            if (!$nodes) {
                continue;
            }

            foreach ($nodes as $node) {
                $result[] = $node;
            }
        }

        return $result;
    }
51126
public function loadFromContentType(ContentType $contentType): self
    {
        $languages = [];
        foreach ($contentType->languageCodes as $languageCode) {
            $languages[] = $this->languageService->loadLanguage($languageCode);
        }

        $this->data = array_map(
            function (Language $language) use ($contentType) {
                return $this->valueFactory->createLanguageFromContentType($language, $contentType);
            },
            $languages
        );

        return $this;
    }
30912
public static function extract(array $content, Translations $translations)
    {
        $messages = \current($content);
        $headers = $messages[''] ?? null;
        unset($messages['']);

        if (!empty($headers['domain'])) {
            $translations->setDomain($headers['domain']);
        }

        if (!empty($headers['lang'])) {
            $translations->setLanguage($headers['lang']);
        }

        if (!empty($headers['plural-forms'])) {
            $translations->setHeader(Translations::HEADER_PLURAL, $headers['plural-forms']);
        }

        $context_glue = '\u0004';

        foreach ($messages as $key => $translation) {
            $key = \explode($context_glue, $key);
            $context = isset($key[1]) ? \array_shift($key) : '';

            $translations->insert($context, \array_shift($key))
                ->setTranslation(\array_shift($translation))
                ->setPluralTranslations($translation);
        }
    }
1321867
public function setJsonContent($content)
    {
        $context = $this->_context;

        $this->setHeader('Content-Type', 'application/json; charset=utf-8');

        if (is_array($content)) {
            if (!isset($content['code'])) {
                $content = ['code' => 0, 'message' => '', 'data' => $content];
            }
        } elseif ($content instanceof \JsonSerializable) {
            $content = ['code' => 0, 'message' => '', 'data' => $content];
        } elseif (is_string($content)) {
            null;
        } elseif (is_int($content)) {
            $content = ['code' => $content, 'message' => ''];
        } elseif ($content === null) {
            $content = ['code' => 0, 'message' => '', 'data' => null];
        } elseif ($content instanceof ValidatorException) {
            $content = ['code' => -2, 'message' => $content->getMessage()];
        } elseif ($content instanceof \Exception) {
            if ($content instanceof \ManaPHP\Exception) {
                $this->setStatus($content->getStatusCode());
                $content = $content->getJson();
            } else {
                $this->setStatus(500);
                $content = ['code' => 500, 'message' => 'Server Internal Error'];
            }
        }

        $context->content = $this->_jsonEncode($content);

        return $this;
    }
1050227
static function ContentMembergroups(Content $content)
    {
        if (!$content->Exists())
        {
            return array();
        }
        $sql = Access::SqlBuilder();
        $tblCmg = ContentMembergroup::Schema()->Table();
        $tblMg = Membergroup::Schema()->Table();
        $join = $sql->Join($tblCmg);
        $joinCondition = $sql->Equals($tblCmg->Field('MemberGroup'), $tblMg->Field('ID'));
        $where = $sql->Equals($tblCmg->Field('Content'), $sql->Value($content->GetID()));
        $orderBy = $sql->OrderList($sql->OrderAsc($tblMg->Field('Name')));
        
        return Membergroup::Schema()->Fetch(false, $where, $orderBy, null, 0, null, $join, JoinType::Inner(), $joinCondition);
    }
674502
private function recursivelyStringify($content = null)
        {
            $return = [];
            if (false === $content || null === $content) {
                return;
            } else if (!is_array($content)) {
                $return[] = $content;
            } else {
                foreach ($content as $element) {
                    $return[] = $this->recursivelyStringify($element);
                }
            }
            return implode('', $return);
        }
730106
public function parse($content)
    {
        $result = [];
        if (strpos($content, '@view') === false) {
            return $result;
        }

        if (preg_match_all($this->pattern, $content, $matches)) {

            for ($i = 0, $c = count($matches[0]); $i < $c; $i++) {
                $result[] = [
                    'property' => $matches[1][$i],
                    'value'    => $matches[2][$i],
                    'type'     => $this->getType($matches[2][$i])
                ];
            }

            return $result;
        }

        return $result;
    }
730010
def get_encodings_from_content(content):
    

    charset_re = re.compile(r'<meta.*?charset=["\']*(.+?)["\'>]', flags=re.I)

    return charset_re.findall(content)