public function getOrCreateStorageLocation ($storageLocation) {
		if (is_int($storageLocation)) {
			try {
				return $this->getStorageLocation($storageLocation);
			} catch (StorageLocationNotFoundException $e) {}	
		}
		
		$sl = new StorageLocation();
		$sl->setName($storageLocation);
			
		PartKeepr::getEM()->persist($sl);
			
		return $sl;
	}
Exemple #2
0
			$category = CategoryManager::getInstance()->addCategory($oCategory);
			
			addCategoryRecursive($aCategories, $aCategory["id"], $category);
			
			$newCategories[$aCategory["id"]] = $oCategory;
		}
	}
	
}

echo "\n";

$r = mysql_query("SELECT * FROM storeloc");

while ($store = mysql_fetch_assoc($r)) {
	$oStorageLocation = new StorageLocation();
	$oStorageLocation->setName(convertText($store["name"]));
	PartKeepr::getEM()->persist($oStorageLocation);
	echo "Migrating storage location ".sprintf("%-40s", $store["name"])."\r";
	$newStorageLocations[$store["id"]] = $oStorageLocation;
}

echo "\n";

/* Add Si-Prefixes */
$data = \Symfony\Component\Yaml\Yaml::load("../setup/data/siprefixes.yaml");

$aSiPrefixes = array();

foreach ($data as $prefixName => $data) {
	$prefix = new SiPrefix();