protected function _addDemoData()
	{
		$ds = DIRECTORY_SEPARATOR;
		$path = __DIR__ . $ds . 'data' . $ds . 'demo-product.php';

		if( ( $data = include( $path ) ) == false ) {
			throw new MShop_Exception( sprintf( 'No file "%1$s" found for product domain', $path ) );
		}

		$context =  $this->_getContext();
		$manager = MShop_Factory::createManager( $context, 'product' );

		foreach( $data as $entry )
		{
			$item = $manager->createItem();
			$item->setTypeId( $this->_getTypeId( 'product/type', 'product', $entry['type'] ) );
			$item->setCode( $entry['code'] );
			$item->setLabel( $entry['label'] );
			$item->setSupplierCode( $entry['supplier'] );
			$item->setDateStart( $entry['start'] );
			$item->setDateEnd( $entry['end'] );
			$item->setStatus( $entry['status'] );

			$manager->saveItem( $item );

			$this->_addRefItems( $entry, $item->getId() );
		}
	}
protected function _addDemoData()
	{
		$ds = DIRECTORY_SEPARATOR;
		$path = __DIR__ . $ds . 'data' . $ds . 'demo-product.php';

		if( ( $data = include( $path ) ) == false ) {
			throw new MShop_Exception( sprintf( 'No file "%1$s" found for product domain', $path ) );
		}

		$context =  $this->_getContext();
		$manager = MShop_Factory::createManager( $context, 'product' );

		foreach( $data as $entry )
		{
			$item = $manager->createItem();
			$item->setTypeId( $this->_getTypeId( 'product/type', 'product', $entry['type'] ) );
			$item->setCode( $entry['code'] );
			$item->setLabel( $entry['label'] );
			$item->setSupplierCode( $entry['supplier'] );
			$item->setDateStart( $entry['start'] );
			$item->setDateEnd( $entry['end'] );
			$item->setStatus( $entry['status'] );

			$manager->saveItem( $item );

			$this->_addRefItems( $entry, $item->getId() );
		}
	}
protected function _addDemoData ( ) { $ ds = DIRECTORY_SEPARATOR ; $ path = __DIR__ . $ ds . 'data' . $ ds . 'demo-product.php' ; if ( ( $ data = include ( $ path ) ) == false ) { throw new MShop_Exception ( sprintf ( 'No file "%1$s" found for product domain' , $ path ) ) ; } $ context = $ this -> _getContext ( ) ; $ manager = MShop_Factory :: createManager ( $ context , 'product' ) ; foreach ( $ data as $ entry ) { $ item = $ manager -> createItem ( ) ; $ item -> setTypeId ( $ this -> _getTypeId ( 'product/type' , 'product' , $ entry [ 'type' ] ) ) ; $ item -> setCode ( $ entry [ 'code' ] ) ; $ item -> setLabel ( $ entry [ 'label' ] ) ; $ item -> setSupplierCode ( $ entry [ 'supplier' ] ) ; $ item -> setDateStart ( $ entry [ 'start' ] ) ; $ item -> setDateEnd ( $ entry [ 'end' ] ) ; $ item -> setStatus ( $ entry [ 'status' ] ) ; $ manager -> saveItem ( $ item ) ; $ this -> _addRefItems ( $ entry , $ item -> getId ( ) ) ; } }
Adds the demo data to the database.

@throws MShop_Exception If the file isn't found
Adds the demo data to the database .