当前位置: 首页>>代码示例>>PHP>>正文


PHP Order::setId方法代码示例

本文整理汇总了PHP中Order::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::setId方法的具体用法?PHP Order::setId怎么用?PHP Order::setId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Order的用法示例。


在下文中一共展示了Order::setId方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: map

 public static function map(Order $order, array $properties)
 {
     if (array_key_exists('id', $properties)) {
         $order->setId($properties['id']);
     }
     if (array_key_exists('user_id', $properties)) {
         $order->setUserId($properties['user_id']);
     }
     if (array_key_exists('business_id', $properties)) {
         $order->setBusinessId($properties['business_id']);
     }
     if (array_key_exists('order_date', $properties)) {
         $formattedDate = $properties['order_date'];
         $orderDate = self::createDateTime($formattedDate);
         if ($orderDate) {
             $order->setDate($orderDate);
         }
     }
     if (array_key_exists('status', $properties)) {
         $order->setStatus($properties['status']);
     }
     if (array_key_exists('assigned_to', $properties)) {
         $order->setAssignedTo($properties['assigned_to']);
     }
     if (array_key_exists('order_details', $properties)) {
         $order->setOrderDetails($properties['order_details']);
     }
 }
开发者ID:beshad,项目名称:dropoff_1_DEC,代码行数:28,代码来源:OrderMapper.php

示例2: createOrder

 public function createOrder(Order $order)
 {
     $order->setId(null);
     $order->setStatus(Order::PENDING);
     $sql = '
         INSERT INTO orders_tb(id,user_id,business_id,order_date,status,order_details)
             VALUES (:id,:user_id,:business_id,:order_date,:status,:order_details)';
     $params = array(':id' => $order->getId(), ':user_id' => $_SESSION['user_id'], ':business_id' => $_POST['business']['id'], ':order_date' => self::formatDateTime($order->getDate()), 'status' => $order->getStatus(), 'order_details' => $order->getOrderDetails());
     return $this->execute($sql, $order, $params);
 }
开发者ID:beshad,项目名称:dropoff_1_DEC,代码行数:10,代码来源:OrderDao.php

示例3: getOrder

 public function getOrder()
 {
     $orders = array();
     $res = mysql_query("SELECT *,orders.id AS oid FROM orders INNER JOIN food ON orders.foods=food.id WHERE orders.user_id='" . $_SESSION['user'] . "'");
     while ($userRow = mysql_fetch_array($res)) {
         $order = new Order();
         $order->setId($userRow['oid']);
         $order->setFoodname($userRow['food']);
         $order->setTotal($userRow['total']);
         $order->setDtime($userRow['dtime']);
         $orders[] = $order;
     }
 }
开发者ID:harjotsingh3878,项目名称:JustBite,代码行数:13,代码来源:processorder.php

示例4: __construct

 /**
  * @param  ItemDao $item_dao
  * @return void
  **/
 public function __construct(ItemDao $item_dao)
 {
     $fp = fopen(ROOT . '/data/AbstractFactory/order.csv', 'r');
     while ($data = fgetcsv($fp, 1000, ',')) {
         $order = new Order();
         $order->setId($data[0]);
         foreach (explode(',', $data[1]) as $item_id) {
             $item = $item_dao->findById($item_id);
             if (!is_null($item)) {
                 $order->addItem($item);
             }
         }
         $this->orders[$order->getId()] = $order;
     }
 }
开发者ID:app2641,项目名称:DesignPatternOnPHP,代码行数:19,代码来源:DbOrderDao.php

示例5: updateStatusFromGet

 /**
  * Updates the Order status with parameter values from the GET request
  * @return  boolean             True on success, false on failure,
  *                              or null (on NOOP)
  * @todo    Should definitely use POST instead.
  */
 static function updateStatusFromGet()
 {
     global $objDatabase, $_ARRAYLANG;
     // Update the order status if valid
     if (!isset($_GET['changeOrderStatus']) || empty($_GET['order_id'])) {
         return null;
     }
     $status = intval($_GET['changeOrderStatus']);
     $order_id = intval($_GET['order_id']);
     if ($status < Order::STATUS_PENDING || $status >= Order::STATUS_MAX || $order_id <= 0) {
         \Message::error($_ARRAYLANG['TXT_SHOP_ORDER_ERROR_UPDATING_STATUS']);
         \Cx\Core\Csrf\Controller\Csrf::redirect('index.php?cmd=Shop&act=orders');
     }
     $objUser = \FWUser::getFWUserObject()->objUser;
     $oldStatus = $objDatabase->getOne('
         SELECT
             `status`
         FROM
             `' . DBPREFIX . 'module_shop' . MODULE_INDEX . '_orders`
         WHERE
             `id`=' . contrexx_input2int($order_id));
     $query = "\n            UPDATE `" . DBPREFIX . "module_shop" . MODULE_INDEX . "_orders`\n               SET `status`={$status},\n                   `modified_by`='" . addslashes($objUser->getUsername()) . "',\n                   `modified_on`='" . date('Y-m-d H:i:s') . "'\n             WHERE `id`={$order_id}";
     if (!$objDatabase->Execute($query)) {
         \Message::error($_ARRAYLANG['TXT_SHOP_ORDER_ERROR_UPDATING_STATUS']);
         \Cx\Core\Csrf\Controller\Csrf::redirect('index.php?cmd=Shop&act=orders');
     }
     $order = new Order();
     $order->setId($order_id);
     if (!empty($_GET['stock_update']) && $_GET['stock_update'] == 1 && ($order->isStockIncreasable($oldStatus, $status) || $order->isStockDecreasable($oldStatus, $status))) {
         $order->updateStock($order->isStockIncreasable($oldStatus, $status));
     }
     // Send an email to the customer
     if (!empty($_GET['sendMail']) && !empty($_GET['order_id'])) {
         // TODO: It might be useful to move this to its own method:
         $hasMail = false;
         $result = null;
         switch ($status) {
             case Order::STATUS_CONFIRMED:
                 $result = ShopLibrary::sendConfirmationMail($_GET['order_id']);
                 $hasMail = true;
                 break;
             case Order::STATUS_COMPLETED:
                 $result = ShopManager::sendProcessedMail($_GET['order_id']);
                 $hasMail = true;
                 break;
         }
         if ($hasMail) {
             if (!empty($result)) {
                 \Message::ok(sprintf($_ARRAYLANG['TXT_EMAIL_SEND_SUCCESSFULLY'], $result));
             } else {
                 \Message::error($_ARRAYLANG['TXT_MESSAGE_SEND_ERROR']);
             }
         }
     }
     \Cx\Core\Csrf\Controller\Csrf::redirect('index.php?cmd=Shop&act=orders');
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:62,代码来源:Orders.class.php

示例6: testInsertOrderViaExtendParameterMap

 function testInsertOrderViaExtendParameterMap()
 {
     $this->sqlmap->getSqlMapManager()->getTypeHandlers()->registerTypeHandler(new HundredsBool());
     $account = $this->newAccount6();
     $this->sqlmap->insert("InsertAccountViaParameterMap", $account);
     $order = new Order();
     $order->setId(99);
     $order->setCardExpiry("09/11");
     $order->setAccount($account);
     $order->setCardNumber("154564656");
     $order->setCardType("Visa");
     $order->setCity("Lyon");
     $order->setDate(null);
     //<-- null replacement
     $order->setPostalCode("69004");
     $order->setProvince("Rhone");
     $order->setStreet("rue Durand");
     $this->sqlmap->insert("InsertOrderViaExtendParameterMap", $order);
     $orderTest = $this->sqlmap->queryForObject("GetOrderLiteByColumnName", 99);
     $this->assertSame($order->getCity(), $orderTest->getCity());
 }
开发者ID:pradosoft,项目名称:prado,代码行数:21,代码来源:ParameterMapTest.php

示例7: testInsertOrderViaProperties

 /**
  *
  */
 function testInsertOrderViaProperties()
 {
     $this->initScript('account-init.sql');
     $this->initScript('order-init.sql');
     $account = $this->NewAccount6();
     $this->sqlmap->Insert("InsertAccountViaParameterMap", $account);
     $order = new Order();
     $order->setId(99);
     $order->setCardExpiry("09/11");
     $order->setAccount($account);
     $order->setCardNumber("154564656");
     $order->setCardType("Visa");
     $order->setCity("Lyon");
     $order->setDate('2005-05-20');
     $order->setPostalCode("69004");
     $order->setProvince("Rhone");
     $order->setStreet("rue Durand");
     $this->sqlmap->Insert("InsertOrderViaPublicFields", $order);
     $this->initScript('account-init.sql');
     $this->initScript('order-init.sql');
 }
开发者ID:Nurudeen,项目名称:prado,代码行数:24,代码来源:StatementTest.php

示例8: Processorder

<?php

include '../include/header2.php';
include '../model/processorder.php';
$processorder = new Processorder();
if (isset($_GET['delete'])) {
    $order = new Order();
    $order->setId($_GET['delete']);
    $processorder->deleteOrder($order);
}
?>
	
	<section id="cart_items">
		<div class="container">
			<div class="breadcrumbs">
				<ol class="breadcrumb">
				  <li><a href="index.php">Home</a></li>
				  <li class="active">My Orders</li>
				</ol>
			</div>
			<?php 
if ($msg_register == 1) {
    ?>
							<div class="alert alert-success">
							  <strong>Success!</strong> Order deleted successfully.
							</div>
						<?php 
} else {
    if ($msg_register == 2) {
        ?>
							<div class="alert alert-danger">
开发者ID:harjotsingh3878,项目名称:JustBite,代码行数:31,代码来源:myorder.php


注:本文中的Order::setId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。