本文整理汇总了PHP中OrderItem::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP OrderItem::getId方法的具体用法?PHP OrderItem::getId怎么用?PHP OrderItem::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderItem
的用法示例。
在下文中一共展示了OrderItem::getId方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSellingItems
/**
* Getting the selling item
*
* @param OrderItem $orderItem
* @param string $serialNo
* @param string $description
* @param Order $order
* @param Product $product
* @param string $activeOnly
* @param string $pageNo
* @param unknown $pageSize
* @param unknown $orderBy
* @param unknown $stats
* @return Ambigous <Ambigous, multitype:, multitype:BaseEntityAbstract >
*/
public static function getSellingItems(OrderItem $orderItem = null, $serialNo = '', $description = '', Order $order = null, Product $product = null, $activeOnly = true, $pageNo = null, $pageSize = DaoQuery::DEFAUTL_PAGE_SIZE, $orderBy = array(), &$stats = array())
{
$where = $params = array();
if (trim($serialNo) !== '') {
$where[] = 'serialNo like ?';
$params[] = $serialNo;
}
if (trim($description) !== '') {
$where[] = 'description like ?';
$params[] = '%' . $description . '%';
}
if ($orderItem instanceof OrderItem) {
$where[] = 'orderItemId = ?';
$params[] = $orderItem->getId();
}
if ($order instanceof Order) {
$where[] = 'orderId = ?';
$params[] = $order->getId();
}
if ($product instanceof Product) {
$where[] = 'productId = ?';
$params[] = $product->getId();
}
if (count($where) === 0) {
return SellingItem::getAll($activeOnly, $pageNo, $pageSize, $orderBy, $stats);
}
$results = SellingItem::getAllByCriteria(implode(' AND ', $where), $params, $activeOnly, $pageNo, $pageSize, $orderBy, $stats);
return $results;
}