本文整理匯總了PHP中DAOFactory::getFilamentDAO方法的典型用法代碼示例。如果您正苦於以下問題:PHP DAOFactory::getFilamentDAO方法的具體用法?PHP DAOFactory::getFilamentDAO怎麽用?PHP DAOFactory::getFilamentDAO使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DAOFactory
的用法示例。
在下文中一共展示了DAOFactory::getFilamentDAO方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: addFilament
/**
* @param unknown $data
*/
function addFilament($data)
{
$existing = DAOFactory::getFilamentDAO()->queryByKeys($data[self::FILAMENT_NAME], $data[self::FILAMENT_TYPE], $data[self::COLOUR], floatval($data[self::DIAMETER]));
echo " \n name : " . $data[self::FILAMENT_NAME] . ' type : ' . $data[self::FILAMENT_TYPE] . ' color : ' . $data[self::COLOUR] . ' dia : ' . floatval($data[self::DIAMETER]);
$filament = new Filament();
if ($existing == NULL) {
// add new filament.
$material = $this->addMaterial($data);
$supplier = $this->addSupplier($data);
$filament->materialId = $material->materialId;
$filament->supplierId = $supplier->supplierId;
$filament->name = $data[self::FILAMENT_NAME];
$filament->color = $data[self::COLOUR];
$filament->size = floatval($data[self::DIAMETER]);
$filament->filamentId = DAOFactory::getFilamentDAO()->insert($filament);
} else {
$filament = $existing[0];
}
echo " \n fil : " . $filament->name . ' color ' . $filament->color;
// will need to check existing filament and material.
// safe bet, if the filament already exists then we can skip a material check/add
}
示例2: getFilament
public static function getFilament()
{
$filament = DAOFactory::getFilamentDAO()->queryAll();
return $filament;
}