controller/jobs/src/Controller/Jobs/Subscription/Process/Renew/Standard.php
protected function createContext( $baseId )
	{
		$context = clone $this->getContext();

		$manager = \Aimeos\MShop::create( $context, 'order/base' );
		$baseItem = $manager->getItem( $baseId );

		$locale = $baseItem->getLocale();
		$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;

		$manager = \Aimeos\MShop::create( $context, 'locale' );
		$locale = $manager->bootstrap( $baseItem->getSiteCode(), $locale->getLanguageId(), $locale->getCurrencyId(), false, $level );

		$context->setLocale( $locale );

		try
		{
			$manager = \Aimeos\MShop::create( $context, 'customer' );
			$customerItem = $manager->getItem( $baseItem->getCustomerId(), ['customer/group'] );

			$context->setUserId( $baseItem->getCustomerId() );
			$context->setGroupIds( $customerItem->getGroups() );
		}
		catch( \Exception $e ) {} // Subscription without account

		return $context;
	}
protected function createContext( $baseId )
	{
		$context = clone $this->getContext();

		$manager = \Aimeos\MShop::create( $context, 'order/base' );
		$baseItem = $manager->getItem( $baseId );

		$locale = $baseItem->getLocale();
		$level = \Aimeos\MShop\Locale\Manager\Base::SITE_ALL;

		$manager = \Aimeos\MShop::create( $context, 'locale' );
		$locale = $manager->bootstrap( $baseItem->getSiteCode(), $locale->getLanguageId(), $locale->getCurrencyId(), false, $level );

		$context->setLocale( $locale );

		try
		{
			$manager = \Aimeos\MShop::create( $context, 'customer' );
			$customerItem = $manager->getItem( $baseItem->getCustomerId(), ['customer/group'] );

			$context->setUserId( $baseItem->getCustomerId() );
			$context->setGroupIds( $customerItem->getGroups() );
		}
		catch( \Exception $e ) {} // Subscription without account

		return $context;
	}
protected function createContext ( $ baseId ) { $ context = clone $ this -> getContext ( ) ; $ manager = \ Aimeos \ MShop :: create ( $ context , 'order/base' ) ; $ baseItem = $ manager -> getItem ( $ baseId ) ; $ locale = $ baseItem -> getLocale ( ) ; $ level = \ Aimeos \ MShop \ Locale \ Manager \ Base :: SITE_ALL ; $ manager = \ Aimeos \ MShop :: create ( $ context , 'locale' ) ; $ locale = $ manager -> bootstrap ( $ baseItem -> getSiteCode ( ) , $ locale -> getLanguageId ( ) , $ locale -> getCurrencyId ( ) , false , $ level ) ; $ context -> setLocale ( $ locale ) ; try { $ manager = \ Aimeos \ MShop :: create ( $ context , 'customer' ) ; $ customerItem = $ manager -> getItem ( $ baseItem -> getCustomerId ( ) , [ 'customer/group' ] ) ; $ context -> setUserId ( $ baseItem -> getCustomerId ( ) ) ; $ context -> setGroupIds ( $ customerItem -> getGroups ( ) ) ; } catch ( \ Exception $ e ) { } // Subscription without account return $ context ; }
Creates a new context based on the order and the customer the subscription belongs to

@param string $baseId Unique order base ID
@return \Aimeos\MShop\Context\Item\Iface New context object
Creates a new context based on the order and the customer the subscription belongs to