controller/jobs/src/Controller/Jobs/Product/Export/Standard.php
protected function export( \Aimeos\MW\Container\Iface $container, $default = true )
	{
		$domains = array( 'attribute', 'media', 'price', 'product', 'text' );

		$domains = $this->getConfig( 'domains', $domains );
		$maxItems = $this->getConfig( 'max-items', 10000 );
		$maxQuery = $this->getConfig( 'max-query', 1000 );

		$start = 0; $filenum = 1;
		$names = [];

		$manager = \Aimeos\MShop::create( $this->getContext(), 'product' );

		$search = $manager->createSearch( $default );
		$search->setSortations( array( $search->sort( '+', 'product.id' ) ) );
		$search->setSlice( 0, $maxQuery );

		$content = $this->createContent( $container, $filenum );
		$names[] = $content->getResource();

		do
		{
			$items = $manager->searchItems( $search, $domains );
			$free = $maxItems * $filenum - $start;
			$count = count( $items );

			if( $free < $count )
			{
				$this->addItems( $content, array_slice( $items, 0, $free, true ) );
				$items = array_slice( $items, $free, null, true );

				$this->closeContent( $content );
				$content = $this->createContent( $container, ++$filenum );
				$names[] = $content->getResource();
			}

			$this->addItems( $content, $items );

			$start += $count;
			$search->setSlice( $start, $maxQuery );
		}
		while( $count >= $search->getSliceSize() );

		$this->closeContent( $content );

		return $names;
	}
protected function export( \Aimeos\MW\Container\Iface $container, $default = true )
	{
		$domains = array( 'attribute', 'media', 'price', 'product', 'text' );

		$domains = $this->getConfig( 'domains', $domains );
		$maxItems = $this->getConfig( 'max-items', 10000 );
		$maxQuery = $this->getConfig( 'max-query', 1000 );

		$start = 0; $filenum = 1;
		$names = [];

		$manager = \Aimeos\MShop::create( $this->getContext(), 'product' );

		$search = $manager->createSearch( $default );
		$search->setSortations( array( $search->sort( '+', 'product.id' ) ) );
		$search->setSlice( 0, $maxQuery );

		$content = $this->createContent( $container, $filenum );
		$names[] = $content->getResource();

		do
		{
			$items = $manager->searchItems( $search, $domains );
			$free = $maxItems * $filenum - $start;
			$count = count( $items );

			if( $free < $count )
			{
				$this->addItems( $content, array_slice( $items, 0, $free, true ) );
				$items = array_slice( $items, $free, null, true );

				$this->closeContent( $content );
				$content = $this->createContent( $container, ++$filenum );
				$names[] = $content->getResource();
			}

			$this->addItems( $content, $items );

			$start += $count;
			$search->setSlice( $start, $maxQuery );
		}
		while( $count >= $search->getSliceSize() );

		$this->closeContent( $content );

		return $names;
	}
protected function export ( \ Aimeos \ MW \ Container \ Iface $ container , $ default = true ) { $ domains = array ( 'attribute' , 'media' , 'price' , 'product' , 'text' ) ; $ domains = $ this -> getConfig ( 'domains' , $ domains ) ; $ maxItems = $ this -> getConfig ( 'max-items' , 10000 ) ; $ maxQuery = $ this -> getConfig ( 'max-query' , 1000 ) ; $ start = 0 ; $ filenum = 1 ; $ names = [ ] ; $ manager = \ Aimeos \ MShop :: create ( $ this -> getContext ( ) , 'product' ) ; $ search = $ manager -> createSearch ( $ default ) ; $ search -> setSortations ( array ( $ search -> sort ( '+' , 'product.id' ) ) ) ; $ search -> setSlice ( 0 , $ maxQuery ) ; $ content = $ this -> createContent ( $ container , $ filenum ) ; $ names [ ] = $ content -> getResource ( ) ; do { $ items = $ manager -> searchItems ( $ search , $ domains ) ; $ free = $ maxItems * $ filenum - $ start ; $ count = count ( $ items ) ; if ( $ free < $ count ) { $ this -> addItems ( $ content , array_slice ( $ items , 0 , $ free , true ) ) ; $ items = array_slice ( $ items , $ free , null , true ) ; $ this -> closeContent ( $ content ) ; $ content = $ this -> createContent ( $ container , ++ $ filenum ) ; $ names [ ] = $ content -> getResource ( ) ; } $ this -> addItems ( $ content , $ items ) ; $ start += $ count ; $ search -> setSlice ( $ start , $ maxQuery ) ; } while ( $ count >= $ search -> getSliceSize ( ) ) ; $ this -> closeContent ( $ content ) ; return $ names ; }
Exports the products into the given container

@param \Aimeos\MW\Container\Iface $container Container object
@param boolean $default True to filter exported products by default criteria
@return array List of content (file) names
Exports the products into the given container