<?php

namespace CouponsPlus\App\Compatibility\Wpml;

use CouponsPlus\Original\Collections\Collection;

class TranslationIdsOnlyWhenCurrentLanguageIsForeign extends GettableDecorator
{
    public function get(int $objectId): Collection
    {
        global $sitepress;

        if ($sitepress->get_default_language() === $sitepress->get_current_language()) {
            return new Collection([]);
        }

        return $this->gettable->get($objectId);
    } 
}