controller/common/src/Controller/Common/Subscription/Process/Processor/Cgroup/Standard.php
public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription )
	{
		if( empty( $this->groupIds ) ) {
			return;
		}

		$context = $this->getContext();

		$manager = \Aimeos\MShop::create( $context, 'customer' );
		$baseManager = \Aimeos\MShop::create( $context, 'order/base' );

		$baseItem = $baseManager->getItem( $subscription->getOrderBaseId() );
		$item = $manager->getItem( $baseItem->getCustomerId(), ['customer/group'] );

		$item->setGroups( array_unique( array_merge( $item->getGroups(), $this->groupIds ) ) );
		$manager->saveItem( $item );
	}
public function begin( \Aimeos\MShop\Subscription\Item\Iface $subscription )
	{
		if( empty( $this->groupIds ) ) {
			return;
		}

		$context = $this->getContext();

		$manager = \Aimeos\MShop::create( $context, 'customer' );
		$baseManager = \Aimeos\MShop::create( $context, 'order/base' );

		$baseItem = $baseManager->getItem( $subscription->getOrderBaseId() );
		$item = $manager->getItem( $baseItem->getCustomerId(), ['customer/group'] );

		$item->setGroups( array_unique( array_merge( $item->getGroups(), $this->groupIds ) ) );
		$manager->saveItem( $item );
	}
public function begin ( \ Aimeos \ MShop \ Subscription \ Item \ Iface $ subscription ) { if ( empty ( $ this -> groupIds ) ) { return ; } $ context = $ this -> getContext ( ) ; $ manager = \ Aimeos \ MShop :: create ( $ context , 'customer' ) ; $ baseManager = \ Aimeos \ MShop :: create ( $ context , 'order/base' ) ; $ baseItem = $ baseManager -> getItem ( $ subscription -> getOrderBaseId ( ) ) ; $ item = $ manager -> getItem ( $ baseItem -> getCustomerId ( ) , [ 'customer/group' ] ) ; $ item -> setGroups ( array_unique ( array_merge ( $ item -> getGroups ( ) , $ this -> groupIds ) ) ) ; $ manager -> saveItem ( $ item ) ; }
Processes the initial subscription

@param \Aimeos\MShop\Subscription\Item\Iface $subscription Subscription item
Processes the initial subscription