public function createNew()
    {
        $resource = $this->traitCreateNew();

        if (!$resource instanceof TranslatableInterface) {
            throw new \InvalidArgumentException('Resource must implement TranslatableInterface.');
        }

        $resource->setCurrentLocale($this->localeProvider->getCurrentLocale());
        $resource->setFallbackLocale($this->localeProvider->getFallbackLocale());

        return $resource;
    }
public function createNew()
    {
        $resource = $this->traitCreateNew();

        if (!$resource instanceof TranslatableInterface) {
            throw new \InvalidArgumentException('Resource must implement TranslatableInterface.');
        }

        $resource->setCurrentLocale($this->localeProvider->getCurrentLocale());
        $resource->setFallbackLocale($this->localeProvider->getFallbackLocale());

        return $resource;
    }
public function createNew ( ) { $ resource = $ this -> traitCreateNew ( ) ; if ( ! $ resource instanceof TranslatableInterface ) { throw new \ InvalidArgumentException ( 'Resource must implement TranslatableInterface.' ) ; } $ resource -> setCurrentLocale ( $ this -> localeProvider -> getCurrentLocale ( ) ) ; $ resource -> setFallbackLocale ( $ this -> localeProvider -> getFallbackLocale ( ) ) ; return $ resource ; }
Returns a new resource instance.

@throws \InvalidArgumentException

@return object
Returns a new resource instance .