本文整理汇总了PHP中Order::getId方法的典型用法代码示例。如果您正苦于以下问题:PHP Order::getId方法的具体用法?PHP Order::getId怎么用?PHP Order::getId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Order
的用法示例。
在下文中一共展示了Order::getId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getComments
public function getComments()
{
$html = '';
$comments = Comments::getAllByCriteria('entityName = ? AND type = ? AND entityId = ?', array('PurchaseOrder', Comments::TYPE_PURCHASING, $this->order->getId()), true, 1, 5, array('comm.id' => 'desc'));
if (count($comments) === 0) {
return '';
}
foreach ($comments as $comment) {
$html .= '<div style="max-width: 670px; word-wrap: break-word; font-weight: bold; color: brown;">' . $comment->getComments() . '</div>';
}
return $html;
}
示例2: execute
private function execute($sql, Order $order, array $params)
{
$statement = $this->getDb()->prepare($sql);
$this->executeStatement($statement, $params);
if (!$order->getId()) {
return $this->findById($this->getDb()->lastInsertId());
}
if (!$statement->rowCount()) {
throw new NotFoundException('USER with ID "' . $order->getId() . '" does not exist.');
}
return $order;
}
示例3: __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;
}
}
示例4: Order
$orderBookId = $_POST['data']['orders']['Order Book Id'];
$client = $cdi->getClientById($clientId);
$order = new Order("");
$order->setOrderDate($orderDate);
if (strcmp(strtolower($orderValid), 'true') === 0) {
$order->setValid(true);
} else {
$order->setValid(false);
}
$order->setClient($client);
if (strcmp(strtolower($orderBookId), 'none') !== 0) {
$ordb = $obi->getOrderBooksById(intval($orderBookId));
$order->addOrderBook($ordb);
}
$entityManager->flush();
$array['DT_RowId'] = $order->getId();
$see['Order Date'] = $order->getDate()->format("d-m-Y");
if ($order->getValid()) {
$see['Valid'] = 'true';
} else {
$see['Valid'] = 'false';
}
$see['Client Id'] = "" . $client->getId() . "";
$see['Order Book Id'] = "" . $orderBookId . "";
$see['Client Name'] = $client->getName();
$array['orders'] = $see;
$seeall['id'] = "" . $orderBookId . "";
$tmp['id'] = "" . $clientId . "";
$array['Order Book Ids'] = $seeall;
$array['Client Ids'] = $tmp;
echo json_encode(array('row' => $array));
示例5: Order
?>
<input type="submit" value="Complete" onClick="setCompleted()">
<?php
//}
?>
<hr>
<table>
<tr><td style="width:200px;">Order Code</td>
<td style="width:200px;">Title</td>
<td style="width:200px;">Client</td>
<td style="width:200px;">Destination</td>
<td style="width:200px;">Action</td>
</tr>
<?php
for ($i = 0; $i < sizeof($orderList); $i++) {
$mOrder = new Order($orderList[$i]);
$mClient = new Client($mOrder->getClient());
echo "<tr>";
echo "<td><a href='../order/detail.php?id=" . $mOrder->getId() . "'>" . $mOrder->getCode() . "</a></td>";
echo "<td>" . $mOrder->getTitle() . "</td>";
echo "<td><a href='../client/detail.php?id=" . $mClient->getId() . "'>" . $mClient->getName() . "</a></td>";
echo "<td>" . $mOrder->getDestination() . "</td>";
echo "<td><input type='submit' value='Assign'><input type='submit' value='Track'></td>";
echo "</tr>";
}
?>
</table>
<div>
</div>
</body>
示例6: getComments
public function getComments()
{
$comments = Comments::getAllByCriteria('entityId = ? and entityName = ? and type = ?', array($this->order->getId(), get_class($this->order), Comments::TYPE_SALES), true, 1, 1, array('id' => 'desc'));
return count($comments) === 0 ? '' : $comments[0]->getComments();
}
示例7: __construct
public function __construct(ItemDao $item_dao)
{
$fp = fopen('order_data.txt', 'r');
$dummy = fgets($fp, 4096);
$this->orders = array();
while ($buffer = fgets($fp, 4096)) {
$order_id = trim(substr($buffer, 0, 10));
$item_ids = trim(substr($buffer, 10));
$order = new Order($order_id);
foreach (split(',', $item_ids) as $item_id) {
$item = $item_dao->findById($item_id);
if (!is_null($item)) {
$order->addItem($item);
}
}
$this->orders[$order->getId()] = $order;
}
fclose($fp);
}
示例8: getParams
private function getParams(Order $order)
{
$params = array(':id' => $order->getId(), ':status' => $order->getStatus(), ':assigned_to' => $order->getAssignedTo());
return $params;
}
示例9: addInstanceToPool
/**
* Adds an object to the instance pool.
*
* Propel keeps cached copies of objects in an instance pool when they are retrieved
* from the database. In some cases -- especially when you override doSelect*()
* methods in your stub classes -- you may need to explicitly add objects
* to the cache in order to ensure that the same objects are always returned by doSelect*()
* and retrieveByPK*() calls.
*
* @param Order $value A Order object.
* @param string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
*/
public static function addInstanceToPool(Order $obj, $key = null)
{
if (Propel::isInstancePoolingEnabled()) {
if ($key === null) {
$key = (string) $obj->getId();
}
// if key === null
self::$instances[$key] = $obj;
}
}
示例10: setOrder
public function setOrder(Order $order)
{
$this->order = $order;
$this->id_order = $order->getId();
return true;
}
示例11: 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;
}
示例12: completeOrder
public function completeOrder($tid)
{
$transaction = Transaction::getTransactionBasedOnTID($tid);
$user = new User($transaction->getUser());
$order = new Order();
$order->setTid($transaction->getTid());
$order->setUser($transaction->getUser());
$order->setCustomerName($user->getName());
$order->setUserEmail($user->getEmail());
$order->setPhone($transaction->getPhone());
$order->setShippingStreet($transaction->getShippingStreet());
$order->setShippingCity($transaction->getShippingCity());
$order->setShippingPostal($transaction->getShippingPostal());
$order->setShippingProvince($transaction->getShippingProvince());
$order->setShippingCountry($transaction->getShippingCountry());
$order->setBillingStreet($transaction->getBillingStreet());
$order->setBillingCity($transaction->getBillingCity());
$order->setBillingPostal($transaction->getBillingPostal());
$order->setBillingProvince($transaction->getBillingProvince());
$order->setBillingCountry($transaction->getBillingCountry());
$order->setCostSubtotal($transaction->getCostSubtotal());
$order->setCostTax($transaction->getCostTax());
$order->setCostShipping($transaction->getCostShipping());
$order->setCostTotal($transaction->getCostTotal());
$order->setIp($transaction->getIp());
$order->setShippingClass($transaction->getShippingClass());
$order->setPaymentClass($transaction->getPaymentClass());
$order->setDeliveryInstructions($transaction->getDeliveryInstructions());
$order->setStatus('Pending');
$order->save();
$cartItems = CartItem::getAll($transaction->getSession());
foreach ($cartItems as $cartItem) {
$product = new Product($cartItem->getProduct());
$orderDetail = new OrderDetail();
$orderDetail->setOrderNb($order->getId());
$orderDetail->setProduct($product->getId());
$orderDetail->setProductName($product->getName());
$orderDetail->setQuantity($cartItem->getQuantity());
$orderDetail->save();
$cartItem->delete();
}
$transaction->delete();
//Send an email to the user
$this->sendEmailOrderComplete($order->getId());
return true;
}
示例13: addOrder
public function addOrder(Order $order)
{
$this->orders[$order->getId()] = $order;
}
示例14: makeDealsWith
private static function makeDealsWith(Deal $deal)
{
$order = new Order();
$order->findById($deal->getOrderId());
if ($order->getType() == OrderType::SELL) {
$oppositeDeals = Deal::getOpenedBuyDeals($order->getPrice(), $order->getRateId());
} else {
$oppositeDeals = Deal::getOpenedSellDeals($order->getPrice(), $order->getRateId());
}
foreach ($oppositeDeals as $oppDeal) {
$oppositeDeal = new Deal();
$oppositeDeal->findById($oppDeal['id']);
$oppositeOrder = new Order();
$oppositeOrder->findById($oppositeDeal->getOrderId());
$difference = $deal->getVolume() - $oppositeDeal->getVolume();
if ($difference == 0) {
$deal->setPrice($oppositeDeal->getPrice());
$deal->setDone(1);
$deal->save();
$order->setPart(1.0);
$order->setStatus(OrderStatus::DONE);
$order->save();
$oppositeDeal->setDone(1);
$oppositeDeal->setDate($deal->getDate());
$oppositeDeal->save();
$oppositeOrder->setPart(1.0);
$oppositeOrder->setStatus(OrderStatus::DONE);
$oppositeOrder->setDate($deal->getDate());
$oppositeOrder->save();
self::transferMoney($deal, $oppositeDeal);
break;
}
$intermediateDeal = new Deal();
$intermediateDeal->setRateId($order->getRateId());
$intermediateDeal->setDate($deal->getDate());
$intermediateDeal->setDone(1);
if ($difference < 0) {
$deal->setPrice($oppositeDeal->getPrice());
$deal->setDone(1);
$deal->save();
$order->setPart(1.0);
$order->setStatus(OrderStatus::DONE);
$order->save();
$intermediateDeal->setOrderId($oppositeOrder->getId());
$intermediateDeal->setUserId($oppositeOrder->getUserId());
$intermediateDeal->setType($oppositeOrder->getType());
$intermediateDeal->setPrice($oppositeDeal->getPrice());
$intermediateDeal->setVolume($deal->getVolume());
$intermediateDeal->insert();
$oppositeOrder->updatePart();
$oppositeOrder->setDate($deal->getDate());
$oppositeOrder->save();
$oppositeDeal->setVolume(-$difference);
$oppositeDeal->setDate($deal->getDate());
$oppositeDeal->save();
self::transferMoney($deal, $intermediateDeal);
break;
} else {
$deal->setVolume($difference);
$deal->save();
$intermediateDeal->setOrderId($order->getId());
$intermediateDeal->setUserId($order->getUserId());
$intermediateDeal->setType($order->getType());
$intermediateDeal->setPrice($oppositeDeal->getPrice());
$intermediateDeal->setVolume($oppositeDeal->getVolume());
$intermediateDeal->insert();
$order->updatePart();
$order->save();
$oppositeDeal->setDone(1);
$oppositeDeal->setDate($deal->getDate());
$oppositeDeal->save();
$oppositeOrder->setPart(1.0);
$oppositeOrder->setStatus(OrderStatus::DONE);
$oppositeOrder->setDate($deal->getDate());
$oppositeOrder->save();
self::transferMoney($intermediateDeal, $oppositeDeal);
}
}
}
示例15: getItems
/**
* Getting the order item via order and product
*
* @param Order $order
* @param Product $product
* @param bool $activeOnly
* @param int $pageNo
* @param int $pageSize
* @param array $orderBy
* @param array $stats
*
* @return Ambigous <Ambigous, multitype:, multitype:BaseEntityAbstract >
*/
public static function getItems(Order $order, Product $product = null, $activeOnly = true, $pageNo = null, $pageSize = DaoQuery::DEFAUTL_PAGE_SIZE, $orderBy = array(), &$stats = array())
{
$where = 'orderId = ?';
$params = array($order->getId());
if ($product instanceof Product) {
$where .= ' AND productId = ?';
$params[] = $product->getId();
}
return self::getAllByCriteria($where, $params, $activeOnly, $pageNo, $pageSize, $orderBy, $stats);
}