admin/jqadm/src/Admin/JQAdm/Product/Selection/Standard.php
protected function fromArrayAttributes( \Aimeos\MShop\Product\Item\Iface $refItem, array $entry )
	{
		$listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' );

		$listItem = $listManager->createItem()->setType( 'variant' );
		$litems = $refItem->getListItems( 'attribute', 'variant', null, false );

		foreach( $entry as $pos => $attr )
		{
			if( !isset( $attr['product.lists.refid'] ) || $attr['product.lists.refid'] == '' ) {
				continue;
			}

			if( ( $litem = $refItem->getListItem( 'attribute', 'variant', $attr['product.lists.refid'], false ) ) === null ) {
				$litem = clone $listItem;
			}

			$litem->fromArray( $attr, true );
			$litem->setPosition( $pos );

			$refItem->addListItem( 'attribute', $litem, $litem->getRefItem() );
			unset( $litems[$litem->getId()] );
		}

		return $refItem->deleteListItems( $litems );
	}
protected function fromArrayAttributes( \Aimeos\MShop\Product\Item\Iface $refItem, array $entry )
	{
		$listManager = \Aimeos\MShop::create( $this->getContext(), 'product/lists' );

		$listItem = $listManager->createItem()->setType( 'variant' );
		$litems = $refItem->getListItems( 'attribute', 'variant', null, false );

		foreach( $entry as $pos => $attr )
		{
			if( !isset( $attr['product.lists.refid'] ) || $attr['product.lists.refid'] == '' ) {
				continue;
			}

			if( ( $litem = $refItem->getListItem( 'attribute', 'variant', $attr['product.lists.refid'], false ) ) === null ) {
				$litem = clone $listItem;
			}

			$litem->fromArray( $attr, true );
			$litem->setPosition( $pos );

			$refItem->addListItem( 'attribute', $litem, $litem->getRefItem() );
			unset( $litems[$litem->getId()] );
		}

		return $refItem->deleteListItems( $litems );
	}
protected function fromArrayAttributes ( \ Aimeos \ MShop \ Product \ Item \ Iface $ refItem , array $ entry ) { $ listManager = \ Aimeos \ MShop :: create ( $ this -> getContext ( ) , 'product/lists' ) ; $ listItem = $ listManager -> createItem ( ) -> setType ( 'variant' ) ; $ litems = $ refItem -> getListItems ( 'attribute' , 'variant' , null , false ) ; foreach ( $ entry as $ pos => $ attr ) { if ( ! isset ( $ attr [ 'product.lists.refid' ] ) || $ attr [ 'product.lists.refid' ] == '' ) { continue ; } if ( ( $ litem = $ refItem -> getListItem ( 'attribute' , 'variant' , $ attr [ 'product.lists.refid' ] , false ) ) === null ) { $ litem = clone $ listItem ; } $ litem -> fromArray ( $ attr , true ) ; $ litem -> setPosition ( $ pos ) ; $ refItem -> addListItem ( 'attribute' , $ litem , $ litem -> getRefItem ( ) ) ; unset ( $ litems [ $ litem -> getId ( ) ] ) ; } return $ refItem -> deleteListItems ( $ litems ) ; }
Updates the variant attributes of the given product item

@param \Aimeos\MShop\Product\Item\Iface $refItem Article item object
@param array $entry Associative list of key/values for product attribute references
@return \Aimeos\MShop\Product\Item\Iface Updated artice item object
Updates the variant attributes of the given product item