Flag all entries with the given namespace, group and item and locale other than default as pending review.
This is used when an entry for the default locale is updated.

@param Translation $entry
@return boolean
775230
public function flagAsUnstable($namespace, $group, $item)
    {
        $this->model->whereNamespace($namespace)->whereGroup($group)->whereItem($item)->where('locale', '!=', $this->defaultLocale)->update(['unstable' => '1']);
    }
431897
public function onEntry($entry)
    {
        if (is_array($entry)) {
            // First item from laravel-zmq is the channel name
            $channel = $entry[0];

            // Second is the actual message (in JSON format)
            $entry = json_decode($entry[1], true);

            // Put the channel name back into the payload
            $entry['channel'] = $channel;

            // And re-encode so it can be sent to clients
            $entry = json_encode($entry);
        }

        // No channel found in the payload or channel doesn't have any subscribers
        if (! $channel || ! array_key_exists($channel, $this->subscribedTopics)) {
            return;
        }

        if (starts_with($channel, 'private-')) {
            // Only get the subscribers to the channel that this should be published on
            $subs = $this->subscribedTopics[$channel];

            foreach ($subs as $to) {
                $this->send($to, $entry);
            }
        } else {
            // If it's public, send to all clients
            $this->sendAll($entry);
        }
    }
751138
protected function validateFactoryEntry($entry)
    {
        if (!is_string($entry) && !is_callable($entry) && !$entry instanceof FactoryInterface) {
            $type = is_object($entry) ? get_class($entry) : gettype($entry);
            $message = sprintf('Argument "entry" in "%s" must be a string, a callable or an instance '
                    . 'of "%s"; "%s" was given.', __METHOD__, FactoryInterface::class, $type);
            throw new Exception\InvalidArgumentException($message);
        }

        if (is_string($entry)) {
            if (!class_exists($entry)) {
                throw new Exception\ClassNotFoundException($entry);
            }

            if (!is_subclass_of($entry, FactoryInterface::class)) {
                $message = sprintf('Entry "%s" in "%s" is expected to be an instance of "%s".', $entry, __METHOD__, FactoryInterface::class);
                throw new Exception\InvalidArgumentException($message);
            }
        }
    }
894154
private function isEntryOutOfScope(array $entry)
    {
        if (empty($entry['path']) && $entry['path'] !== '0') {
            return false;
        }

        if ($this->recursive) {
            return $this->residesInDirectory($entry);
        }

        return $this->isDirectChild($entry);
    }
432163
public function search($entry)
    {
        $data = TrimContentTransformer::trim($this->fileReader->read());

        if (in_array($entry, $data)) {
            return true;
        }

        foreach ($data as $item) {
            if (0 === strpos($entry, $item)) {
                return true;
            }
        }

        return false;
    }
612395
public function setTranslateEntry(TranslateEntry $translateEntry)
    {
        if (is_null($this->translateEntry)) {
            throw new ParserContextException('TranslateEntry should be generated through `generateTranslateEntry()` function first.');
        }
        $this->translateEntry = $translateEntry;

        return $this;
    }
452833
private function is_group_entry($entry)
    {
        $classes = array_map('strtolower', (array)$entry['objectclass']);

        return count(array_intersect(array_keys($this->group_types), $classes)) > 0;
    }
67430
private function getVatTypeField(array $entry)
    {
        if (!empty($entry['vatreversecharge'])) {
            if (!empty($entry['foreigneu'])) {
                $vatType = API::VatType_EuReversed;
            } else {
                $vatType = API::VatType_NationalReversed;
            }
        } elseif (!empty($entry['marginscheme'])) {
            $vatType = API::VatType_MarginScheme;
        } elseif (!empty($entry['foreignvat'])) {
            $vatType = API::VatType_ForeignVat;
        } elseif (!empty($entry['foreignnoneu'])) {
            $vatType = API::VatType_RestOfWorld;
        } else {
            $vatType = API::VatType_National;
        }
        return array(
            'vat_type' => array(
            'type' => 'markup',
            'label' => $this->t('vat_type'),
            'value' => $this->t('vat_type_' . $vatType),
            ),
        );
    }
313520
protected function parseListEntry( $entry )
	{
		$data	= array();
		$parts	= preg_split("/[\s]+/", $entry, 9 );
		if( $parts[0] == "total" )
			return array();
		$data['isdir']			= $parts[0]{0} === "d";
		$data['islink']			= $parts[0]{0} === "l";
		$data['isfile']			= $parts[0]{0} === "-";
		$data['permissions']	= $parts[0];
		$data['number']			= $parts[1];
		$data['owner']			= $parts[2];
		$data['group']			= $parts[3];
		$data['size']			= $parts[4];
		$data['month']			= $parts[5];
		$data['day']			= $parts[6];
		$data['time']			= $parts[7];
		$data['name']			= $parts[8];
		if( preg_match( "/:/", $data['time'] ) )
			$data['year']		= date( "Y" );
		else
		{
			$data['year']		= $data['time'];
			$data['time']		= "00:00";
		}
		$data['timestamp']		= strtotime( $data['day']." ".$data['month']." ".$data['year']." ".$data['time'] );
		$data['datetime']		= date( "c", $data['timestamp'] );
		$data['type']			= $this->fileTypes[$parts[0]{0}];
		$data['type_short']		= $data['type']{0};
		$data['octal']			= $this->getPermissionsAsOctal( $parts[0] );
		$data['raw']			= $entry;
		return $data;
	}
178282
public function updateEntries($msgid, $translation)
    {
        if (
            !isset($this->entriesAsArrays[$msgid])
            || !is_array($translation)
            || sizeof($translation) != sizeof($this->entriesAsArrays[$msgid]['msgstr'])
        ) {
            throw new \Exception('Cannot update entry translation');
        }
        $this->removeFuzzyFlagForMsgId($msgid);
        $this->entriesAsArrays[$msgid]['msgstr'] = $translation;
    }
644954
protected function setTranslationFromEditor($access, LocaleEntity $locale, TranslatableEntity $translatable, UserEntity $user, PackageVersionEntity $packageVersion = null)
    {
        $translation = null;
        $strings = $this->post('translated');
        $numStrings = ($translatable->getPlural() === '') ? 1 : $locale->getPluralCount();
        if (is_array($strings)) {
            $strings = array_values($strings);
            if (count($strings) === $numStrings) {
                foreach ($strings as $index => $string) {
                    if (is_string($string)) {
                        $string = str_replace("\r", "\n", str_replace("\r\n", "\n", $string));
                    } else {
                        $string = '';
                    }
                    if (trim($string) === '') {
                        $translation = null;
                        break;
                    }
                    if ($index === 0) {
                        $translation = TranslationEntity::create($locale, $translatable, $strings[0]);
                    } else {
                        $translation->{"setText$index"}($string);
                    }
                }
            }
        }
        if ($translation === null) {
            throw new UserMessageException(t('Please specify the translations'));
        }
        if ($access >= Access::ADMIN) {
            if ($this->post('approved') === '1') {
                $approved = true;
            } elseif ($this->post('approved') === '0') {
                $approved = false;
            } else {
                throw new UserMessageException(t('Missing parameter: %s', 'approved'));
            }
        } else {
            $approved = false;
        }

        $translations = $this->convertTranslationToGettext($translation, !$approved);
        $importer = $this->app->make(Importer::class);
        $imported = $importer->import($translations, $locale, $user, ($access >= Access::ADMIN) ? ImportOptions::forAdministrators() : ImportOptions::forTranslators());
        $this->getEntityManager()->clear();
        $translatable = $this->app->make(TranslatableRepository::class)->find($translatable->getID());
        $locale = $this->app->make(LocaleRepository::class)->find($locale->getID());
        if ($imported->newApprovalNeeded > 0) {
            $this->app->make(NotificationRepository::class)->translationsNeedApproval(
                $locale,
                $imported->newApprovalNeeded,
                $user->getUserID(),
                ($packageVersion === null) ? null : $packageVersion->getID()
            );
        }

        $result = $this->app->make(Editor::class)->getTranslations($locale, $translatable);
        if ($imported->newApprovalNeeded && !$imported->addedAsCurrent) {
            $result['message'] = t('Since the current translation is approved, you have to wait that this new translation will be approved');
        }

        return $this->app->make(ResponseFactoryInterface::class)->json($result);
    }
10833
public function addEntry( $entry, $section )
	{
		if( isset( $this->list[$section] ) && is_array( $this->list[$section] ) && in_array( $entry, $this->list[$section] ) )
			throw new InvalidArgumentException( 'Entry "'.$entry.'" is already in Section "'.$section.'".' );
		$this->list[$section][] = $entry;
	}
947296
public function filter($value)
    {
        return true === array_key_exists((string)$value, $this->translations) ? $this->translations[$value] : null;
    }
96376
public function updateMainTranslation( $locale )
    {
        $trans = $this->translationByLocale( $locale );
        /** @var eZContentLanguage $language */
        $language = eZContentLanguage::fetchByLocale( $locale );
        if ( !$trans instanceof eZTagsKeyword || !$language instanceof eZContentLanguage )
            return false;

        $this->setAttribute( 'main_language_id', $language->attribute( 'id' ) );
        $keyword = $this->getKeyword( $locale );
        $this->setAttribute( 'keyword', $keyword );
        $this->store();

        $isAlwaysAvailable = $this->isAlwaysAvailable();
        foreach ( $this->getTranslations() as $translation )
        {
            if ( !$isAlwaysAvailable )
                $languageID = (int) $translation->attribute( 'language_id' ) & ~1;
            else
            {
                if ( $translation->attribute( 'locale' ) != $language->attribute( 'locale' ) )
                    $languageID = (int) $translation->attribute( 'language_id' ) & ~1;
                else
                    $languageID = (int) $translation->attribute( 'language_id' ) | 1;
            }

            $translation->setAttribute( 'language_id', $languageID );
            $translation->store();
        }

        return true;
    }
1170701
private function processTranscription(array $sourceTextGroup, DictionaryEntry $entry): void
    {
        if (!empty($sourceTextGroup['ts'])) {
            $entry->setTranscription($sourceTextGroup['ts']);
        }
    }
699502
protected function _createItem( array $entry )
	{
		$item = $this->_manager->createItem();

		foreach( $entry as $name => $value )
		{
			switch( $name )
			{
				case 'locale.id': $item->setId( $value ); break;
				case 'locale.siteid': $item->setSiteId( $value ); break;
				case 'locale.languageid': $item->setLanguageId( $value ); break;
				case 'locale.currencyid': $item->setCurrencyId( $value ); break;
				case 'locale.position': $item->setPosition( $value ); break;
				case 'locale.status': $item->setStatus( $value ); break;
			}
		}

		return $item;
	}
1248603
public static function adjustArray(&$entry) {
        global $CFG;
        if ( isset($entry) && !is_array($entry) ) {
            $entry = array($entry);
        }
        for($i=0; $i < count($entry); $i++ ) {
            if ( is_string($entry[$i]) ) U::absolute_url_ref($entry[$i]);
            if ( isset($entry[$i]->href) && is_string($entry[$i]->href) ) U::absolute_url_ref($entry[$i]->href);
            if ( isset($entry[$i]->launch) && is_string($entry[$i]->launch) ) U::absolute_url_ref($entry[$i]->launch);
        }
    }