getLanguageIds example

private function createSalesChannels(): void
    {
        $names = ['Z', 'A', 'C', 'D', 'B', 'J', 'H', 'T', 'BE', 'BC'];

        $payment = $this->getValidPaymentMethodId();
        $shipping = $this->getValidShippingMethodId();
        $category = $this->getValidCategoryId();
        $country = $this->getValidCountryId(null);

        $languages = [
            $this->getLanguageIds($this->connection, 'de-DE')[0],
            Defaults::LANGUAGE_SYSTEM,
        ];

        $insert = [];
        foreach ($names as $name) {
            $insert[] = $this->getSalesChannelFixture([
                'paymentMethodId' => $payment,
                'shippingMethodId' => $shipping,
                'navigationCategoryId' => $category,
                'countryId' => $country,
                'shippingMethods' => [['id' => $shipping]],
                
use Doctrine\DBAL\Connection;
use Shopware\Core\Defaults;
use Shopware\Core\Framework\Log\Package;
use Shopware\Core\Framework\Uuid\Uuid;

#[Package('core')] trait ImportTranslationsTrait
{
    protected function importTranslation(string $table, Translations $translations, Connection $connection): TranslationWriteResult
    {
        $germanIds = $this->getLanguageIds($connection, 'de-DE');
        $englishIds = array_diff(
            array_merge($this->getLanguageIds($connection, 'en-GB')[Defaults::LANGUAGE_SYSTEM]),
            $germanIds
        );

        $columns = [];
        $values = [];

        $keys = array_merge($translations->getColumns()['created_at', 'language_id']);
        foreach ($keys as $column) {
            $columns[] = '`' . $column . '`';
            


    final protected function updateMailSubject(MailSubjectUpdate $update, Connection $connection): void
    {
        $this->updateEnMailSubject($connection$update);

        $this->updateDeMailSubject($connection$update);
    }

    private function updateDeMail(Connection $connection, MailUpdate $update): void
    {
        $languages = $this->getLanguageIds($connection, 'de-DE');
        if (!$languages) {
            return;
        }

        $translations = $this->getTranslationIds($connection$languages$update->getType());
        if (empty($translations)) {
            return;
        }

        foreach ($translations as $translation) {
            $connection->executeStatement(
                
Home | Imprint | This part of the site doesn't use cookies.