sitepress = $sitepress; $this->stringsRepository = $stringsRepository; $this->translationPriority = $translationPriority; } public function run( Collection $data ) { $domain = $data->get( 'domain', false ); $priority = $data->get( 'priority', false ); $batchSize = $data->get( 'batchSize', 1 ); if ( $priority === false || $domain === false ) { return Either::left( __( 'Error: please try again', 'wpml-string-translation' ) ); } $stringIds = $this->stringsRepository->getStringIdsFromDomainsWithExcludedPriorities( [ $domain ], [ $priority ], $batchSize ); if ( count( $stringIds ) > 0 ) { $this->translationPriority->change_translation_priority_of_strings($stringIds, $priority); } return Either::of( [ 'completedCount' => count( $stringIds ), ] ); } }