本文整理汇总了PHP中DAOFactory::getMaterialDAO方法的典型用法代码示例。如果您正苦于以下问题:PHP DAOFactory::getMaterialDAO方法的具体用法?PHP DAOFactory::getMaterialDAO怎么用?PHP DAOFactory::getMaterialDAO使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DAOFactory
的用法示例。
在下文中一共展示了DAOFactory::getMaterialDAO方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addMaterial
/**
* @param unknown $data
*/
function addMaterial($data)
{
// check to see if the material type exists
// if not then add it.
// if so then update it.
$material = new Material();
$existing = DAOFactory::getMaterialDAO()->queryByType($data[self::FILAMENT_TYPE]);
echo ' material ' . $material->type . ' id ' . $material->materialId . ' data : ' . $data[self::FILAMENT_TYPE];
if ($existing == NULL) {
$material->type = $data[self::FILAMENT_TYPE];
$material->materialId = DAOFactory::getMaterialDAO()->insert($material);
} else {
$material = $existing;
}
return $material;
}
示例2: queryByKeys
public function queryByKeys($name, $type, $color, $diameter)
{
$material = DAOFactory::getMaterialDAO()->queryByType($type);
$sql = 'select * from filament where name = ? and material_id = ? and color = ? and size = ?';
$sqlQuery = new SqlQuery($sql);
$sqlQuery->set($name);
$sqlQuery->setNumber($material->materialId);
$sqlQuery->set($color);
$sqlQuery->setNumber($diameter);
return $this->getList($sqlQuery);
}
示例3: getMaterials
public static function getMaterials()
{
$materials = DAOFactory::getMaterialDAO()->queryAll();
return $materials;
}
示例4: getMaterials
/**
* pull back the materials based on a given printer
* @param unknown $printerId
*/
public static function getMaterials($printerId)
{
$materials = DAOFactory::getMaterialDAO()->queryMaterialsByPrinterId($printerId);
return $materials;
}