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


PHP Vendor::getVendorByVendorId方法代码示例

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


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

示例1: testGetInvalidVendorByVendorId

 /**
  * test grabbing a Vendor that does not exist
  **/
 public function testGetInvalidVendorByVendorId()
 {
     // grab a vendor id that exceeds the maximum allowable vendor id
     $vendor = Vendor::getVendorByVendorId($this->getPDO(), InventoryTextTest::INVALID_KEY);
     $this->assertNull($vendor);
 }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:9,代码来源:vendor-test.php

示例2: verifyXsrf

     }
     // post to a new Vendor
 } else {
     if ($method === "POST") {
         // convert POSTed JSON to an object
         verifyXsrf();
         $requestContent = file_get_contents("php://input");
         $requestObject = json_decode($requestContent);
         $vendor = new Vendor(null, $requestObject->contactName, $requestObject->vendorEmail, $requestObject->vendorName, $requestObject->vendorPhoneNumber);
         $vendor->insert($pdo);
         $reply->data = "Vendor created OK";
         // delete an existing Vendor
     } else {
         if ($method === "DELETE") {
             verifyXsrf();
             $vendor = Vendor::getVendorByVendorId($pdo, $vendorId);
             $vendor->delete($pdo);
             $reply->data = "Vendor deleted OK";
             // put to an existing Vendor
         } else {
             if ($method === "PUT") {
                 // convert PUTed JSON to an object
                 verifyXsrf();
                 $requestContent = file_get_contents("php://input");
                 $requestObject = json_decode($requestContent);
                 $vendor = new Vendor($vendorId, $requestObject->contactName, $requestObject->vendorEmail, $requestObject->vendorName, $requestObject->vendorPhoneNumber);
                 $vendor->update($pdo);
                 $reply->data = "Vendor Updated Ok";
             }
         }
     }
开发者ID:sandidgec,项目名称:foodinventory,代码行数:31,代码来源:index.php

示例3: foreach

    $allProducts = Product::getAllProducts($pdo, 0);
    foreach ($allProducts as $product) {
        $numberOfProducts = 0;
        // Make an array of product location from the above product
        $productLocations = ProductLocation::getProductLocationByProductId($pdo, $product->getProductId());
        foreach ($productLocations as $productLocation) {
            $numberOfProducts = $numberOfProducts + $productLocation->getQuantity();
        }
        // check if levels trigger notification according to alert operator
        $productAlerts = ProductAlert::getProductAlertByProductId($pdo, $product->getProductId());
        foreach ($productAlerts as $productAlert) {
            $alertLevel = AlertLevel::getAlertLevelByAlertId($pdo, $productAlert->getAlertId());
            if ($alertLevel->getAlertOperator() === "<" && $numberOfProducts < $alertLevel->getAlertPoint() || $alertLevel->getAlertOperator() === ">" && $numberOfProducts > $alertLevel->getAlertPoint()) {
                // give warning
                $productTitle = $product->getTitle();
                $vendor = Vendor::getVendorByVendorId($pdo, $product->getVendorId());
                $vendorName = $vendor->getVendorName();
                $message = $message . <<<EOF
\t\t\t\t<tr>
\t\t\t\t\t<td>{$productTitle}</td>
\t\t\t\t\t<td>{$numberOfProducts}</td>
\t\t\t\t\t<td>{$vendorName}</td>
\t\t\t\t</tr>
EOF;
            }
        }
    }
    $message = $message . <<<EOF
\t\t\t</tbody>
EOF;
    /**
开发者ID:sandidgec,项目名称:foodinventory,代码行数:31,代码来源:notification-generator.php


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