partkeepr

fork of partkeepr
git clone https://git.e1e0.net/partkeepr.git
Log | Files | Refs | Submodules | README | LICENSE

commit c62327d54ddb2ffbb4abb4da02ef0324fdf5f993
parent 2386e9d70ac0b9a8eb778366ac6dffde2473cdad
Author: Felicitus <felicitus@felicitus.org>
Date:   Tue, 21 Jun 2011 07:19:04 +0200

Put old footprints into an "Imported" category

Diffstat:
Mtesting/SetupDatabase.php | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/testing/SetupDatabase.php b/testing/SetupDatabase.php @@ -108,8 +108,6 @@ echo "Creating footprints from SetupData/footprints.php\n"; /* Import pre-defined footprints */ $data = \Symfony\Component\Yaml\Yaml::load("../setup/data/footprints/footprints.yaml"); -print_r($data); - $footprintCategoryManager = FootprintCategoryManager::getInstance(); $footprintCategoryManager->ensureRootExists(); @@ -191,6 +189,10 @@ while ($sFootprint = mysql_fetch_assoc($r)) { $footprint->setName(convertText($sFootprint["name"])); echo " Adding footprint ".$sFootprint["name"]."\r"; + + $footprintCategory = addFootprintPath(explode("/", "Imported Footprints"), $footprintCategoryManager->getRootNode()); + $footprint->setCategory($footprintCategory->getNode()); + PartKeepr::getEM()->persist($footprint); $newFootprints[$sFootprint["id"]] = $footprint;