Пример #1
0
	/**
	 * Sets the data for the distributor.
	 * @param Distributor $distributor The distributor to process
	 */
	private function setDistributorData (Distributor $distributor) {
		$distributor->setName($this->getParameter("name"));
		$distributor->setComment($this->getParameter("comment", ""));
		$distributor->setAddress($this->getParameter("address", ""));
		$distributor->setURL($this->getParameter("url", ""));
		$distributor->setEmail($this->getParameter("email", ""));
	}
Пример #2
0
	/**
	 * Creates a new distributor with the given name.
	 * @param string $name The name of the distributor
	 * @return Distributor The new distributor object
	 */
	public function addDistributor ($name) {
		$distributor = new Distributor();
		$distributor->setName($name);
		
		PartKeepr::getEM()->persist($distributor);
		PartKeepr::getEM()->flush();
		
		return $distributor;
	}
Пример #3
0
	foreach ($logos as $logo) {
		$mfglogo = new ManufacturerICLogo();
		$mfglogo->setManufacturer($manufacturer);
		$mfglogo->replace("../setup/data/manufacturers/images/".$logo);
		$mfglogo->setOriginalFilename($logo);
		
		PartKeepr::getEM()->persist($mfglogo);
	}
}

PartKeepr::getEM()->flush();

$r = mysql_query("SELECT * FROM suppliers");
while ($supplier = mysql_fetch_assoc($r)) {
	$distributor = new Distributor();
	$distributor->setName($supplier["name"]);
	
	PartKeepr::getEM()->persist($distributor);
	$aDistributors[$supplier["id"]] = $distributor;
}

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

$aRandomUnitNames = array("Spannung", "Strom", "Leitfähigkeit", "Viskosität", "Nessis");

$fc=0;

while ($part = mysql_fetch_assoc($r)) {
	$oPart = new Part();
	$oPart->setName(convertText($part["name"]));
	$oPart->setComment(convertText($part["comment"]));