<?php



use Idearia\Logger;



class PipelineAccBranch extends Pipeline {



	public function import() {



		Logger::info( "PipelineAccBranch::import() started" );



		if ($branchId = $this->itemId) {

	

			Logger::debug( "PipelineAccBranch::import() BRANCH={$branchId}" );

			$accProductController = new AccProductController();

			if ($accProductController->loadBranch($branchId) && $accProductController->loadWooProducts()) {

				$accProductController->prepareImportProducts();

				return true;

			}

		} else {

			Logger::debug( "PipelineAccBranch::import() NO BRANCH" );

			$accProductController = new AccProductController();

			$accProductController->prepareImportBranches();

			return true;

		}



		return false;

	}



	public function flushsync() {



		return false;

	}





}