admin/jsonadm/src/Admin/JsonAdm/Base.php
protected function saveRelationships( \Aimeos\MShop\Common\Manager\Iface $manager,
		\Aimeos\MShop\Common\Item\Iface $item, \stdClass $relationships )
	{
		$id = $item->getId();
		$listManager = $manager->getSubManager( 'lists' );

		foreach( (array) $relationships as $domain => $list )
		{
			if( isset( $list->data ) )
			{
				foreach( (array) $list->data as $data )
				{
					$listItem = $listManager->createItem();

					if( isset( $data->attributes ) && ( $attr = (array) $data->attributes ) ) {
						$item = $item->fromArray( $attr, true );
					}

					if( isset( $data->id ) ) {
						$listItem->setRefId( $data->id );
					}

					$listItem->setParentId( $id );
					$listItem->setDomain( $domain );

					$listManager->saveItem( $listItem, false );
				}
			}
		}
	}
protected function saveRelationships( \Aimeos\MShop\Common\Manager\Iface $manager,
		\Aimeos\MShop\Common\Item\Iface $item, \stdClass $relationships )
	{
		$id = $item->getId();
		$listManager = $manager->getSubManager( 'lists' );

		foreach( (array) $relationships as $domain => $list )
		{
			if( isset( $list->data ) )
			{
				foreach( (array) $list->data as $data )
				{
					$listItem = $listManager->createItem();

					if( isset( $data->attributes ) && ( $attr = (array) $data->attributes ) ) {
						$item = $item->fromArray( $attr, true );
					}

					if( isset( $data->id ) ) {
						$listItem->setRefId( $data->id );
					}

					$listItem->setParentId( $id );
					$listItem->setDomain( $domain );

					$listManager->saveItem( $listItem, false );
				}
			}
		}
	}
protected function saveRelationships ( \ Aimeos \ MShop \ Common \ Manager \ Iface $ manager , \ Aimeos \ MShop \ Common \ Item \ Iface $ item , \ stdClass $ relationships ) { $ id = $ item -> getId ( ) ; $ listManager = $ manager -> getSubManager ( 'lists' ) ; foreach ( ( array ) $ relationships as $ domain => $ list ) { if ( isset ( $ list -> data ) ) { foreach ( ( array ) $ list -> data as $ data ) { $ listItem = $ listManager -> createItem ( ) ; if ( isset ( $ data -> attributes ) && ( $ attr = ( array ) $ data -> attributes ) ) { $ item = $ item -> fromArray ( $ attr , true ) ; } if ( isset ( $ data -> id ) ) { $ listItem -> setRefId ( $ data -> id ) ; } $ listItem -> setParentId ( $ id ) ; $ listItem -> setDomain ( $ domain ) ; $ listManager -> saveItem ( $ listItem , false ) ; } } } }
Saves the item references associated via the list

@param \Aimeos\MShop\Common\Manager\Iface $manager Manager responsible for the items
@param \Aimeos\MShop\Common\Item\Iface $item Domain item with an unique ID set
@param \stdClass $relationships Object including the <domain>/data/attributes structure
Saves the item references associated via the list