Provides all languages an object is indexed in
@param eZContentObject $contentObject

@return array of languages (as strings)
195358
public function getLanguagesForObject( eZContentObject $contentObject)
    {
        $languages = array();

        $params = array(
            'fl' => 'meta_language_code_ms',
            'fq' => 'meta_id_si:' . $contentObject->attribute( 'id' )
        );

        if ( $this->UseMultiLanguageCores === true )
        {
            foreach ( $this->SolrLanguageShards as $shard )
            {
                /** @var eZSolrBase $shard */
                $languages = array_merge(
                    $languages,
                    $this->extractLanguageCodesFromSolrResult( $shard->rawSearch( $params ) )
                );
            }
        }
        else
        {
            $languages = array_merge(
                $languages,
                $this->extractLanguageCodesFromSolrResult( $this->Solr->rawSearch( $params ) )
            );
        }

        return $languages;
    }
968261
protected function getCollections(Content $content, $isRoot = false)
    {
        $languages = $this->getConfigResolver()->getParameter('languages');

        $query = new Query([
            'contentId' => $content->content->id,
            'limit' => Query::COUNT_QUERY,
        ]);

        $count = $this->service->getCollections($query);

        return array(
            'id' => $content->content->id,
            'parent' => $isRoot ? '#' : '0',
            'text' => $content->contentType->getName($languages[0]) . ' (' . strval($count->count) . ')',
            'children' => false,
            'a_attr' => array(
                'href' => $this->router->generate('netgen_information_collection.route.admin.collection_list', ['contentId' => $content->content->id]),
                'rel' => $content->content->id,
            ),
            'state' => array(
                'opened' => $isRoot,
            ),
            'data' => array(
                'context_menu' => array(
                    array(
                        'name' => 'export',
                        'url' => $this->router->generate('netgen_information_collection.route.admin.export', ['contentId' => $content->content->id]),
                        'text' => $this->translator->trans('netgen_information_collection_admin_export_export', [], 'netgen_information_collection_admin'),
                    ),
                ),
            ),
        );
    }
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;
    }
817758
static function fetchList( $asObject = true )
    {
        return eZPersistentObject::fetchObjectList( eZPDFExport::definition(),
                                                    null,
                                                    array( 'version' => eZPDFExport::VERSION_VALID ),
                                                    null,
                                                    null,
                                                    $asObject );
    }
246618
public function getContentIdsByContentTypeId($contentTypeId)
    {
        $query = $this->dbHandler->createSelectQuery();
        $query
            ->select($this->dbHandler->quoteColumn('id'))
            ->from($this->dbHandler->quoteTable('ezcontentobject'))
            ->where(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('contentclass_id'),
                    $query->bindValue($contentTypeId, null, PDO::PARAM_INT)
                )
            );

        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(PDO::FETCH_COLUMN);
    }
1263456
function metaData( $contentObjectAttribute )
    {
        $object = $this->objectAttributeContent( $contentObjectAttribute );
        if ( $object )
        {
            // Does the related object exist in the same language as the current content attribute ?
            if ( in_array( $contentObjectAttribute->attribute( 'language_code' ), $object->attribute( 'current' )->translationList( false, false ) ) )
            {
                $attributes = $object->attribute( 'current' )->contentObjectAttributes( $contentObjectAttribute->attribute( 'language_code' ) );
            }
            else
            {
                $attributes = $object->contentObjectAttributes();
            }

            return eZContentObjectAttribute::metaDataArray( $attributes, true );
        }
        return false;
    }
95718
function objectAttributeContent( $contentObjectAttribute )
    {
        $contentObjectAttributeID = $contentObjectAttribute->attribute( 'id' );
        $contentObjectAttributeVersion = $contentObjectAttribute->attribute( 'version' );
        $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
        $id = $contentClassAttribute->attribute( 'id' );
        $version = $contentClassAttribute->attribute( 'version' );
        $ismultiple = $contentClassAttribute->attribute( 'data_int1' );
        $isoption = $contentClassAttribute->attribute( 'data_int2' );
        $enum = new eZEnum( $id, $version );
        $enum->setIsmultipleValue( $ismultiple );
        $enum->setIsoptionValue( $isoption );
        $enum->setObjectEnumValue( $contentObjectAttributeID, $contentObjectAttributeVersion );
        return $enum;
    }
1246345
static function fetchByContentObjectID( $contentObjectID, $languageCode = null, $asObject = true )
    {
        $condition = array();
        $condition['contentobject_id'] = $contentObjectID;
        $condition['data_type_string'] = 'ezmedia';
        if ( $languageCode != null )
        {
            $condition['language_code'] = $languageCode;
        }
        $custom = array( array( 'operation' => 'DISTINCT id',
                             'name' => 'id' ) );
        $ids = eZPersistentObject::fetchObjectList( eZContentObjectAttribute::definition(),
                                             array(),
                                             $condition,
                                             null,
                                             null,
                                             false,
                                             false,
                                             $custom );
        $mediaFiles = array();
        foreach ( $ids as $id )
        {
            $mediaFileObjectAttribute = eZMedia::fetch( $id['id'], null, $asObject );
            $mediaFiles = array_merge( $mediaFiles, $mediaFileObjectAttribute );
        }
        return $mediaFiles;
    }
568180
static function userDataHandling( $contentObject )
    {
        if ( !$contentObject )
            return false;
        $type = eZInformationCollection::typeForObject( $contentObject );

        $ini = eZINI::instance( 'collect.ini' );
        $userDataList = $ini->variable( 'CollectionSettings', 'CollectionUserDataList' );

        $userData = false;

        if ( isset( $userDataList[$type] ) )
            $userData = $userDataList[$type];

        $userDataAttribute = $ini->variable( 'CollectionSettings', 'CollectionUserDataAttribute' );
        if ( $userDataAttribute )
        {
            $dataMap = $contentObject->attribute( 'data_map' );
            if ( isset( $dataMap[$userDataAttribute] ) )
            {
                $userData = $dataMap[$userDataAttribute]->content();
                if ( is_array( $userData ) or
                     is_object( $userData ) )
                    $userData = false;
            }
        }

        if ( !$userData )
            $userData = $ini->variable( 'CollectionSettings', 'CollectionUserData' );

        if ( !in_array( $userData, array( 'multiple', 'unique', 'overwrite' ) ) )
            $userData = 'unique';

        return $userData;
    }
881650
static function fetchAll( $asObject = true )
    {
        return eZPersistentObject::fetchObjectList( eZUserSetting::definition(),
                                                    null,
                                                    null,
                                                    null,
                                                    null,
                                                    $asObject );
    }
978066
function objectAttributeContent( $contentObjectAttribute )
    {
        $value = $contentObjectAttribute->attribute( 'data_text' );

        $countryList = explode( ',', $value );
        $resultList = array();
        foreach ( $countryList as $alpha2 )
        {
            $eZCountry = eZCountryType::fetchCountry( $alpha2, 'Alpha2' );
            $resultList[$alpha2] = $eZCountry ? $eZCountry : '';
        }
        // Supporting of previous version format.
        // For backwards compatibility.
        if ( count( $resultList ) == 1 and $resultList[$value] == '' )
            $resultList = $value;

        $content = array( 'value' => $resultList );
        return $content;
    }
955228
public function mapFields(Content $content, $languageCode)
    {
        $fieldsGrouped = [[]];
        $contentType = $this->contentTypeHandler->load(
            $content->versionInfo->contentInfo->contentTypeId
        );

        foreach ($content->fields as $field) {
            if ($field->languageCode !== $languageCode) {
                continue;
            }

            $fieldsGrouped[] = $this->mapField($contentType, $field);
        }

        return array_merge(...$fieldsGrouped);
    }
716615
protected function getContentLocationIds($contentObjectId)
    {
        $query = $this->databaseHandler->createSelectQuery();
        $query->select('node_id')
            ->from($this->databaseHandler->quoteTable(self::CONTENTOBJECT_TREE_TABLE))
            ->where($query->expr->eq('contentobject_id', $contentObjectId));
        $stmt = $query->prepare();
        $stmt->execute();
        $nodeIds = $stmt->fetchAll(PDO::FETCH_COLUMN);

        return is_array($nodeIds) ? array_map('intval', $nodeIds) : [];
    }
1255232
function objectAttributeContent( $contentObjectAttribute )
    {
        $dataText = $contentObjectAttribute->attribute( self::CLASS_LIST_FIELD );

        $content = array(
            "classes" => array(),
            "class_identifiers" => array(),
            "class_ids" => array()
        );

        if ( !empty( $dataText ) )
        {
            $classIdentifiers = explode( ",", $dataText );

            foreach ( $classIdentifiers as $classIdentifier )
            {
                $class = eZContentClass::fetchByIdentifier( $classIdentifier );
                if ( $class instanceof eZContentClass )
                {
                    $content["classes"][] = $class;
                    $content["class_identifiers"][] = $classIdentifier;
                    $content["class_ids"][] = (int) $class->attribute( "id" );
                }
            }
        }

        return $content;
    }
872097
public function getUsedLanguages( core_kernel_classes_Property $property)
    {
        $returnValue = array();
        $returnValue = $this->getImplementation()->getUsedLanguages($this, $property);
        return (array) $returnValue;
    }
664516
public function setContentObject($contentObject)
    {
        if (!is_object($contentObject)) {
            throw new \InvalidArgumentException('Argument must be an object, ' . \gettype($contentObject) . ' given.', 1283522467);
        }
        if ($this->contentObjectProxy === null || $this->contentObjectProxy->getObject() !== $contentObject) {
            $this->contentObjectProxy = new ContentObjectProxy($contentObject);
            $this->addOrUpdate();
        }
    }
1346103
public static function getCustomerUsedLanguages($nb_customer)
    {
        $nb_customer_id = nb_getMixedValue($nb_customer, NABU_CUSTOMER_FIELD_ID);
        if (is_numeric($nb_customer_id)) {
            $nb_language_list = CNabuLanguage::buildObjectListFromSQL(
                'nb_language_id',
                'select l.* '
                . 'from nb_language l, '
                     . '(select distinct nb_language_id '
                        . 'from nb_medioteca ca, nb_medioteca_lang cal '
                       . 'where ca.nb_medioteca_id=cal.nb_medioteca_id '
                         . 'and ca.nb_customer_id=%cust_id$d) as lid '
               . 'where l.nb_language_id=lid.nb_language_id',
                array('cust_id' => $nb_customer_id)
            );
        } else {
            $nb_language_list = new CNabuLanguageList();
        }
        
        return $nb_language_list;
    }