Esempio n. 1
0
/* Create initial test user */
$user = new User();
$user->setUsername("test");
$user->setPassword("test");
$user->setAdmin(true);
PartKeepr::getEM()->persist($user);

/* Create footprints */

$newFootprints = array();
$newCategories = array();

mysql_connect("localhost", "partdb", "partdb");
mysql_select_db("partdb");

$partUnit = new PartUnit();
$partUnit->setName(PartKeepr::i18n("Pieces"));
$partUnit->setShortName(PartKeepr::i18n("pcs"));
$partUnit->setDefault(true);

PartKeepr::getEM()->persist($partUnit);
PartKeepr::getEM()->flush();

echo "Creating footprints from SetupData/footprints.php\n";

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

while ($sFootprint = mysql_fetch_assoc($r)) {
	$footprint = new Footprint();
	$footprint->setName(convertText($sFootprint["name"]));
Esempio n. 2
0
	private function setPartUnitData (PartUnit $partUnit) {
		$partUnit->setName($this->getParameter("name"));
		$partUnit->setShortName($this->getParameter("shortName",""));
	}