本文整理汇总了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;
}