• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Supplier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Supplier的典型用法代码示例。如果您正苦于以下问题:PHP Supplier类的具体用法?PHP Supplier怎么用?PHP Supplier使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: StockCreationExample

 public function StockCreationExample()
 {
     $metric = new Metric();
     $metric->name = 'Unit';
     $metric->symbol = 'U';
     $metric->save();
     //Now, create a category to store the inventory record under:
     $category = new Category();
     $category->name = 'VoIP';
     $category->save();
     $item = new Inventory();
     $item->metric_id = $metric->id;
     $item->category_id = $category->id;
     $item->name = 'SNOM Headset';
     $item->description = 'Very nice for the ear';
     $item->save();
     $location = new Location();
     $location->name = 'Snowball Small Stock Room';
     $location->save();
     $item->createStockOnLocation(2, $location);
     $item->createSku('PART1234');
     dd($item->sku_code);
     //$res = Inventory::findBySku(Input::get('sku'));
     //$item = Inventory::find(1);
     //dd($item);
     $supplier = new Supplier();
     //Mandatory fields
     $supplier->name = 'Miro Distribution';
     //Optional fields
     $supplier->address = 'Montague Gardens';
     $supplier->postal_code = '8000';
     $supplier->zip_code = '12345';
     $supplier->country = 'South Africa';
     $supplier->region = 'Western Cape';
     $supplier->city = 'Cape Town';
     $supplier->contact_title = 'Sales Rep';
     $supplier->contact_name = 'Mark Sparky';
     $supplier->contact_phone = '555 555-5555';
     $supplier->contact_fax = '555 555-5556';
     $supplier->contact_email = '[email protected]';
     $supplier->save();
     $item = Inventory::find(1);
     //$supplier = Supplier::find(1);
     $item->addSupplier($supplier);
 }
开发者ID:eugenevdm,项目名称:StockControl2,代码行数:45,代码来源:AddController.php


示例2: processDatafeed

 public static function processDatafeed(Supplier $supplier, array $data)
 {
     $base = dirname(__FILE__);
     if (file_exists($file_name = $base . '/datafeed/' . strtolower($supplier->getName()) . '.php') === true) {
         require_once $file_name;
     }
     $class = ucfirst($supplier->getName()) . 'Connector';
     return $class::run($data);
 }
开发者ID:larryu,项目名称:magento-b2b,代码行数:9,代码来源:SupplierConnector.php


示例3: saveItem

 /**
  * (non-PHPdoc)
  * @see DetailsPageAbstract::saveItem()
  */
 public function saveItem($sender, $param)
 {
     $results = $errors = array();
     try {
         Dao::beginTransaction();
         if (!isset($param->CallbackParameter->id)) {
             throw new Exception('Invalid supplier ID passed in!');
         }
         $supplier = ($id = trim($param->CallbackParameter->id)) === '' ? new Supplier() : Supplier::get($id);
         if (!$supplier instanceof Supplier) {
             throw new Exception('Invalid supplier passed in!');
         }
         $contactName = trim($param->CallbackParameter->address->contactName);
         $contactNo = trim($param->CallbackParameter->address->contactNo);
         $street = trim($param->CallbackParameter->address->street);
         $city = trim($param->CallbackParameter->address->city);
         $region = trim($param->CallbackParameter->address->region);
         $postCode = trim($param->CallbackParameter->address->postCode);
         $country = trim($param->CallbackParameter->address->country);
         $address = $supplier->getAddress();
         $supplier->setName(trim($param->CallbackParameter->name))->setDescription(trim($param->CallbackParameter->description))->setContactNo(trim($param->CallbackParameter->contactNo))->setEmail(trim($param->CallbackParameter->email))->setAddress(Address::create($street, $city, $region, $country, $postCode, $contactName, $contactNo, $address))->save();
         $results['url'] = '/supplier/' . $supplier->getId() . '.html' . (isset($_REQUEST['blanklayout']) ? '?blanklayout=' . $_REQUEST['blanklayout'] : '');
         $results['item'] = $supplier->getJson();
         Dao::commitTransaction();
     } catch (Exception $ex) {
         Dao::rollbackTransaction();
         $errors[] = $ex->getMessage() . $ex->getTraceAsString();
     }
     $param->ResponseData = StringUtilsAbstract::getJson($results, $errors);
 }
开发者ID:larryu,项目名称:magento-b2b,代码行数:34,代码来源:DetailsController.php


示例4: saveOrder

 /**
  * saveOrder
  *
  * @param unknown $sender
  * @param unknown $param
  *
  * @throws Exception
  *
  */
 public function saveOrder($sender, $param)
 {
     $results = $errors = array();
     $daoStart = false;
     try {
         Dao::beginTransaction();
         $daoStart = true;
         $supplier = Supplier::get(trim($param->CallbackParameter->supplier->id));
         if (!$supplier instanceof Supplier) {
             throw new Exception('Invalid Supplier passed in!');
         }
         $supplierContactName = trim($param->CallbackParameter->supplier->contactName);
         $supplierContactNo = trim($param->CallbackParameter->supplier->contactNo);
         $supplierEmail = trim($param->CallbackParameter->supplier->email);
         if (!empty($supplierContactName) && $supplierContactName !== $supplier->getContactName()) {
             $supplier->setContactName($supplierContactName);
         }
         if (!empty($supplierContactNo) && $supplierContactNo !== $supplier->getContactNo()) {
             $supplier->setContactNo($supplierContactNo);
         }
         if (!empty($supplierEmail) && $supplierEmail !== $supplier->getEmail()) {
             $supplier->setEmail($supplierEmail);
         }
         $supplier->save();
         $purchaseOrder = PurchaseOrder::create($supplier, trim($param->CallbackParameter->supplierRefNum), $supplierContactName, $supplierContactNo, StringUtilsAbstract::getValueFromCurrency(trim($param->CallbackParameter->shippingCost)), StringUtilsAbstract::getValueFromCurrency(trim($param->CallbackParameter->handlingCost)))->setTotalAmount(StringUtilsAbstract::getValueFromCurrency(trim($param->CallbackParameter->totalPaymentDue)))->setEta(trim($param->CallbackParameter->eta))->setStatus(PurchaseOrder::STATUS_NEW)->save()->addComment(trim($param->CallbackParameter->comments), Comments::TYPE_PURCHASING);
         foreach ($param->CallbackParameter->items as $item) {
             if (!($product = Product::get(trim($item->productId))) instanceof Product) {
                 throw new Exception('Invalid Product passed in!');
             }
             $purchaseOrder->addItem($product, StringUtilsAbstract::getValueFromCurrency(trim($item->unitPrice)), 0 - abs(intval(trim($item->qtyOrdered))));
         }
         if ($param->CallbackParameter->submitToSupplier === true) {
             $purchaseOrder->setStatus(PurchaseOrder::STATUS_ORDERED);
         }
         // For credit PO
         if (isset($param->CallbackParameter->type) && trim($param->CallbackParameter->type) === 'CREDIT') {
             $purchaseOrder->setIsCredit(true);
             if (isset($param->CallbackParameter->po) && ($fromPO = PurchaseOrder::get(trim($param->CallbackParameter->po->id))) instanceof PurchaseOrder) {
                 $purchaseOrder->setFromPO($fromPO);
             }
         }
         $purchaseOrder->save();
         $daoStart = false;
         Dao::commitTransaction();
         $results['item'] = $purchaseOrder->getJson();
         if (isset($param->CallbackParameter->confirmEmail) && trim($confirmEmail = trim($param->CallbackParameter->confirmEmail)) !== '') {
             $pdfFile = EntityToPDF::getPDF($purchaseOrder);
             $asset = Asset::registerAsset($purchaseOrder->getPurchaseOrderNo() . '.pdf', file_get_contents($pdfFile), Asset::TYPE_TMP);
             EmailSender::addEmail('[email protected]', $confirmEmail, 'BudgetPC Purchase Order:' . $purchaseOrder->getPurchaseOrderNo(), 'Please Find the attached PurchaseOrder(' . $purchaseOrder->getPurchaseOrderNo() . ') from BudgetPC.', array($asset));
             EmailSender::addEmail('[email protected]', '[email protected]', 'BudgetPC Purchase Order:' . $purchaseOrder->getPurchaseOrderNo(), 'Please Find the attached PurchaseOrder(' . $purchaseOrder->getPurchaseOrderNo() . ') from BudgetPC.', array($asset));
             $purchaseOrder->addComment('An email sent to "' . $confirmEmail . '" with the attachment: ' . $asset->getAssetId(), Comments::TYPE_SYSTEM);
         }
     } catch (Exception $ex) {
         if ($daoStart === true) {
             Dao::rollbackTransaction();
         }
         $errors[] = $ex->getMessage();
     }
     $param->ResponseData = StringUtilsAbstract::getJson($results, $errors);
 }
开发者ID:larryu,项目名称:magento-b2b,代码行数:69,代码来源:POCreditController.php


示例5: _getEndJs

 /**
  * (non-PHPdoc)
  * @see CRUDPageAbstract::_getEndJs()
  */
 protected function _getEndJs()
 {
     $manufactureArray = $supplierArray = $statuses = $productCategoryArray = array();
     foreach (Manufacturer::getAll() as $os) {
         $manufactureArray[] = $os->getJson();
     }
     foreach (Supplier::getAll() as $os) {
         $supplierArray[] = $os->getJson();
     }
     foreach (ProductStatus::getAll() as $os) {
         $statuses[] = $os->getJson();
     }
     foreach (ProductCategory::getAll() as $os) {
         $productCategoryArray[] = $os->getJson();
     }
     $js = parent::_getEndJs();
     if (($product = Product::get($this->Request['id'])) instanceof Product) {
         $js .= "\$('searchPanel').hide();";
         $js .= "pageJs._singleProduct = true;";
     }
     $js .= 'pageJs._loadManufactures(' . json_encode($manufactureArray) . ')';
     $js .= '._loadSuppliers(' . json_encode($supplierArray) . ')';
     $js .= '._loadCategories(' . json_encode($productCategoryArray) . ')';
     $js .= '._loadProductStatuses(' . json_encode($statuses) . ')';
     $js .= "._loadChosen()";
     $js .= "._bindSearchKey()";
     $js .= ".setCallbackId('priceMatching', '" . $this->priceMatchingBtn->getUniqueID() . "')";
     $js .= ".setCallbackId('toggleActive', '" . $this->toggleActiveBtn->getUniqueID() . "')";
     $js .= ".getResults(true, " . $this->pageSize . ");";
     return $js;
 }
开发者ID:larryu,项目名称:magento-b2b,代码行数:35,代码来源:ProductController.php


示例6: getTemplateVarSitemap

 public function getTemplateVarSitemap()
 {
     $pages = [];
     $catalog_mode = Configuration::isCatalogMode();
     $cms = CMSCategory::getRecurseCategory($this->context->language->id, 1, 1, 1);
     foreach ($cms['cms'] as $p) {
         $pages[] = ['id' => 'cms-page-' . $p['id_cms'], 'label' => $p['meta_title'], 'url' => $this->context->link->getCMSLink(new CMS($p['id_cms']))];
     }
     $pages[] = ['id' => 'stores-page', 'label' => $this->trans('Our stores', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('stores')];
     $pages[] = ['id' => 'contact-page', 'label' => $this->trans('Contact us', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('contact')];
     $pages[] = ['id' => 'sitemap-page', 'label' => $this->trans('Sitemap', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('sitemap')];
     $pages[] = ['id' => 'login-page', 'label' => $this->trans('Log in', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('authentication')];
     $pages[] = ['id' => 'register-page', 'label' => $this->trans('Create new account', array(), 'Shop.Theme'), 'url' => $this->context->link->getPageLink('authentication')];
     $catalog = ['new-product' => ['id' => 'new-product-page', 'label' => $this->trans('New products', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('new-products')]];
     if ($catalog_mode && Configuration::get('PS_DISPLAY_BEST_SELLERS')) {
         $catalog['best-sales'] = ['id' => 'best-sales-page', 'label' => $this->trans('Best sellers', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('best-sales')];
         $catalog['prices-drop'] = ['id' => 'prices-drop-page', 'label' => $this->trans('Price drop', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('prices-drop')];
     }
     if (Configuration::get('PS_DISPLAY_SUPPLIERS')) {
         $manufacturers = Manufacturer::getLiteManufacturersList($this->context->language->id, 'sitemap');
         $catalog['manufacturer'] = ['id' => 'manufacturer-page', 'label' => $this->trans('Manufacturers', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('manufacturer'), 'children' => $manufacturers];
         $suppliers = Supplier::getLiteSuppliersList($this->context->language->id, 'sitemap');
         $catalog['supplier'] = ['id' => 'supplier-page', 'label' => $this->trans('Suppliers', array(), 'Shop.Theme.Catalog'), 'url' => $this->context->link->getPageLink('supplier'), 'children' => $suppliers];
     }
     $categories = Category::getRootCategory()->recurseLiteCategTree(0, 0, null, null, 'sitemap');
     $catalog['category'] = ['id' => 'category-page', 'label' => $this->trans('Categories', array(), 'Shop.Theme.Catalog'), 'url' => '#', 'children' => $categories['children']];
     $sitemap = [['id' => 'page-page', 'label' => $this->trans('Pages', array(), 'Shop.Theme'), 'url' => '#', 'children' => $pages], ['id' => 'catalog-page', 'label' => $this->trans('Catalog', array(), 'Shop.Theme'), 'url' => '#', 'children' => $catalog]];
     return $sitemap;
 }
开发者ID:M03G,项目名称:PrestaShop,代码行数:29,代码来源:SitemapController.php


示例7: getInstance

 /**
  * @return null|object|Supplier
  * get singleton instance
  */
 public static function getInstance()
 {
     if (!self::$instance) {
         self::$instance = new Supplier();
     }
     return self::$instance;
 }
开发者ID:anggadarkprince,项目名称:web-businesscareer,代码行数:11,代码来源:Supplier.class.php


示例8: renderForm

 public function renderForm()
 {
     if (!$this->object->id) {
         $this->object->price = -1;
     }
     $this->fields_form = array('legend' => array('title' => $this->l('Catalog price rules'), 'icon' => 'icon-dollar'), 'input' => array(array('type' => 'text', 'label' => $this->l('Name'), 'name' => 'name', 'maxlength' => 32, 'required' => true, 'hint' => $this->l('Forbidden characters') . ' <>;=#{}'), array('type' => 'select', 'label' => $this->l('Shop'), 'name' => 'shop_id', 'options' => array('query' => Shop::getShops(), 'id' => 'id_shop', 'name' => 'name'), 'condition' => Shop::isFeatureActive(), 'default_value' => Shop::getContextShopID()), array('type' => 'select', 'label' => $this->l('Currency'), 'name' => 'id_currency', 'options' => array('query' => array_merge(array(0 => array('id_currency' => 0, 'name' => $this->l('All currencies'))), Currency::getCurrencies()), 'id' => 'id_currency', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Country'), 'name' => 'id_country', 'options' => array('query' => array_merge(array(0 => array('id_country' => 0, 'name' => $this->l('All countries'))), Country::getCountries((int) $this->context->language->id)), 'id' => 'id_country', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Group'), 'name' => 'id_group', 'options' => array('query' => array_merge(array(0 => array('id_group' => 0, 'name' => $this->l('All groups'))), Group::getGroups((int) $this->context->language->id)), 'id' => 'id_group', 'name' => 'name')), array('type' => 'text', 'label' => $this->l('From quantity'), 'name' => 'from_quantity', 'maxlength' => 10, 'required' => true), array('type' => 'text', 'label' => $this->l('Price (tax excl.)'), 'name' => 'price', 'disabled' => $this->object->price == -1 ? 1 : 0, 'maxlength' => 10, 'suffix' => $this->context->currency->getSign('right')), array('type' => 'checkbox', 'name' => 'leave_bprice', 'values' => array('query' => array(array('id' => 'on', 'name' => $this->l('Leave base price'), 'val' => '1', 'checked' => '1')), 'id' => 'id', 'name' => 'name')), array('type' => 'datetime', 'label' => $this->l('From'), 'name' => 'from'), array('type' => 'datetime', 'label' => $this->l('To'), 'name' => 'to'), array('type' => 'select', 'label' => $this->l('Reduction type'), 'name' => 'reduction_type', 'options' => array('query' => array(array('reduction_type' => 'amount', 'name' => $this->l('Amount')), array('reduction_type' => 'percentage', 'name' => $this->l('Percentage'))), 'id' => 'reduction_type', 'name' => 'name')), array('type' => 'select', 'label' => $this->l('Reduction with or without taxes'), 'name' => 'reduction_tax', 'align' => 'center', 'options' => array('query' => array(array('lab' => $this->l('Tax included'), 'val' => 1), array('lab' => $this->l('Tax excluded'), 'val' => 0)), 'id' => 'val', 'name' => 'lab')), array('type' => 'text', 'label' => $this->l('Reduction'), 'name' => 'reduction', 'required' => true)), 'submit' => array('title' => $this->l('Save')));
     if (($value = $this->getFieldValue($this->object, 'price')) != -1) {
         $price = number_format($value, 6);
     } else {
         $price = '';
     }
     $this->fields_value = array('price' => $price, 'from_quantity' => ($value = $this->getFieldValue($this->object, 'from_quantity')) ? $value : 1, 'reduction' => number_format(($value = $this->getFieldValue($this->object, 'reduction')) ? $value : 0, 6), 'leave_bprice_on' => $price ? 0 : 1);
     $attribute_groups = array();
     $attributes = Attribute::getAttributes((int) $this->context->language->id);
     foreach ($attributes as $attribute) {
         if (!isset($attribute_groups[$attribute['id_attribute_group']])) {
             $attribute_groups[$attribute['id_attribute_group']] = array('id_attribute_group' => $attribute['id_attribute_group'], 'name' => $attribute['attribute_group']);
         }
         $attribute_groups[$attribute['id_attribute_group']]['attributes'][] = array('id_attribute' => $attribute['id_attribute'], 'name' => $attribute['name']);
     }
     $features = Feature::getFeatures((int) $this->context->language->id);
     foreach ($features as &$feature) {
         $feature['values'] = FeatureValue::getFeatureValuesWithLang((int) $this->context->language->id, $feature['id_feature'], true);
     }
     $this->tpl_form_vars = array('manufacturers' => Manufacturer::getManufacturers(), 'suppliers' => Supplier::getSuppliers(), 'attributes_group' => $attribute_groups, 'features' => $features, 'categories' => Category::getSimpleCategories((int) $this->context->language->id), 'conditions' => $this->object->getConditions(), 'is_multishop' => Shop::isFeatureActive());
     return parent::renderForm();
 }
开发者ID:jpodracky,项目名称:dogs,代码行数:27,代码来源:AdminSpecificPriceRuleController.php


示例9: setVariables

 /**
  * Contains the testing sample data for the ReceiptController.
  *
  * @return void
  */
 public function setVariables()
 {
     // Initial sample storage data
     $this->input = array('commodity' => Commodity::find(1)->id, 'supplier' => Supplier::find(1)->id, 'quantity' => '200', 'batch_no' => '4535', 'expiry_date' => '2015-07-17');
     // Edition sample data
     $this->inputUpdate = array('commodity' => Commodity::find(1)->id, 'supplier' => Supplier::find(1)->id, 'quantity' => '200', 'batch_no' => '4535', 'expiry_date' => '2015-07-17');
 }
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:12,代码来源:ReceiptControllerTest.php


示例10: edit

 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $receipt = Receipt::find($id);
     $suppliers = Supplier::all()->lists('name', 'id');
     $commodities = Commodity::all()->lists('name', 'id');
     return View::make('receipt.edit')->with('receipt', $receipt)->with('commodities', $commodities)->with('suppliers', $suppliers);
 }
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:13,代码来源:ReceiptController.php


示例11: hookDisplayLeftColumn

 function hookDisplayLeftColumn($params)
 {
     $id_lang = (int) Context::getContext()->language->id;
     if (!$this->isCached('blocksupplier.tpl', $this->getCacheId())) {
         $this->smarty->assign(array('suppliers' => Supplier::getSuppliers(false, $id_lang), 'link' => $this->context->link, 'text_list' => Configuration::get('SUPPLIER_DISPLAY_TEXT'), 'text_list_nb' => Configuration::get('SUPPLIER_DISPLAY_TEXT_NB'), 'form_list' => Configuration::get('SUPPLIER_DISPLAY_FORM'), 'display_link_supplier' => Configuration::get('PS_DISPLAY_SUPPLIERS')));
     }
     return $this->display(__FILE__, 'blocksupplier.tpl', $this->getCacheId());
 }
开发者ID:dev-lav,项目名称:htdocs,代码行数:8,代码来源:blocksupplier.php


示例12: updateProduct

function updateProduct($pro, $fileName, $line)
{
    $clientScript = CatelogConnector::getConnector(B2BConnector::CONNECTOR_TYPE_CATELOG, getWSDL(), 'B2BUser', 'B2BUser');
    try {
        $transStarted = false;
        try {
            Dao::beginTransaction();
        } catch (Exception $e) {
            $transStarted = true;
        }
        $sku = trim($pro['sku']);
        $product = Product::getBySku($pro['sku']);
        $mageId = trim($pro['product_id']);
        $name = trim($pro['name']);
        $short_description = trim($pro['short_description']);
        $description = trim($pro['description']);
        $weight = trim($pro['weight']);
        $statusId = trim($pro['status']);
        $price = trim($pro['price']);
        $specialPrice = trim($pro['special_price']);
        $specialPrice_From = trim($pro['special_from_date']) === '' ? trim($pro['special_from_date']) : null;
        $specialPrice_To = trim($pro['special_to_date']) === '' ? trim($pro['special_to_date']) : null;
        $supplierName = trim($pro['supplier']);
        $attributeSet = ProductAttributeSet::get(trim($pro['attributeSetId']));
        if (!$product instanceof Product) {
            $product = Product::create($sku, $name);
        }
        $asset = ($assetId = trim($product->getFullDescAssetId())) === '' || !($asset = Asset::getAsset($assetId)) instanceof Asset ? Asset::registerAsset('full_desc_' . $sku, $description, Asset::TYPE_PRODUCT_DEC) : $asset;
        $product->setName($name)->setMageId($mageId)->setAttributeSet($attributeSet)->setShortDescription($short_description)->setFullDescAssetId(trim($asset->getAssetId()))->setIsFromB2B(true)->setStatus(ProductStatus::get($statusId))->setSellOnWeb(true)->setManufacturer($clientScript->getManufacturerName(trim($pro['manufacturer'])))->save()->clearAllPrice()->addPrice(ProductPriceType::get(ProductPriceType::ID_RRP), $price)->addInfo(ProductInfoType::ID_WEIGHT, $weight);
        if ($specialPrice !== '') {
            $product->addPrice(ProductPriceType::get(ProductPriceType::ID_CASUAL_SPECIAL), $specialPrice, $specialPrice_From, $specialPrice_To);
        }
        if ($supplierName !== '') {
            $product->addSupplier(Supplier::create($supplierName, $supplierName, true));
        }
        if (isset($pro['categories']) && count($pro['categories']) > 0) {
            $product->clearAllCategory();
            foreach ($pro['categories'] as $cateMageId) {
                if (!($category = ProductCategory::getByMageId($cateMageId)) instanceof ProductCategory) {
                    continue;
                }
                $product->addCategory($category);
            }
        }
        if ($transStarted === false) {
            Dao::commitTransaction();
        }
        //TODO remove the file
        removeLineFromFile($fileName, $line);
        echo $product->getId() . " => done! \n";
    } catch (Exception $ex) {
        if ($transStarted === false) {
            Dao::rollbackTransaction();
        }
        throw $ex;
    }
}
开发者ID:larryu,项目名称:magento-b2b,代码行数:57,代码来源:test.php


示例13: postProcess

 /**
  * Method postProcess() : add or update supplier object
  *
  * @module now_seo_links
  * @return object Supplier
  *
  * @see AdminSuppliersControllerCore::postProcess()
  */
 public function postProcess()
 {
     $aShops = array_keys(Tools::getValue('checkBoxShopAsso_supplier', array()));
     // Check if name already exist
     if (Supplier::nameIsAlreadyUsed(Tools::getValue('id_supplier'), Tools::getValue('name'), $aShops)) {
         $this->errors[] = Tools::displayError('Ce nom de fournisseur existe déjà et ne peut être utilisé une nouvelle fois.');
     }
     return parent::postProcess();
 }
开发者ID:TheTypoMaster,项目名称:neonflexible,代码行数:17,代码来源:AdminSuppliersController.php


示例14: testDelete

 /**
  * Tests the update function in the SupplierController
  * @depends testStore
  * @param void
  * @return void
  */
 public function testDelete()
 {
     $this->be(User::first());
     $this->runStore($this->input);
     $supplier = new SupplierController();
     $supplier->delete(1);
     $supplierDeleted = Supplier::withTrashed()->find(1);
     $this->assertNotNull($supplierDeleted->deleted_at);
 }
开发者ID:BaobabHealthTrust,项目名称:iBLIS,代码行数:15,代码来源:SupplierControllerTest.php


示例15: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $del = Supplier::find($id)->delete();
     if ($del) {
         echo "Your Item Deleted";
     } else {
         echo "Not Found or Already Deleted";
     }
 }
开发者ID:rana7cse,项目名称:motoshop,代码行数:15,代码来源:SupplierController.php


示例16: __checkExistence

 /**
  * Checks if the parameter is a valid supplier id
  * @param $id int
  * @return Supplier object if $id is found, otherwise false
  */
 private function __checkExistence($id)
 {
     if (!is_null($id) && $id != '') {
         $supplier = Supplier::withTrashed()->find($id);
         if (is_null($supplier)) {
             return false;
         }
         return $supplier;
     }
     return false;
 }
开发者ID:frankpaul142,项目名称:cloudinventory,代码行数:16,代码来源:SupplierController.php


示例17: SupplierAndItemInfo

 public function SupplierAndItemInfo()
 {
     App::uses("Supplier", "Inventory.Model");
     App::import("Model", "Inventory.Item");
     $supplierModel = new Supplier();
     $itemModel = new Item();
     $supplierModel->recursive = 0;
     $suppliers = $supplierModel->find("all");
     $tmp_suplliers = array();
     foreach ($suppliers as $key => $supplier) {
         $tmp_suplliers[$supplier['Supplier']['id']]['name'] = $supplier['Supplier']['name'];
         $tmp_suplliers[$supplier['Supplier']['id']]['email'] = $supplier['Supplier']['email'];
         $tmp_suplliers[$supplier['Supplier']['id']]['gst'] = $supplier['Supplier']['gst_rate'];
         $tmp_suplliers[$supplier['Supplier']['id']]['pst'] = $supplier['Supplier']['pst_rate'];
         $tmp_suplliers[$supplier['Supplier']['id']]['item'] = $itemModel->find("list", array("fields" => array("id_plus_item"), 'conditions' => array('supplier_id' => $supplier['Supplier']['id'])));
         $tmp_suplliers[$supplier['Supplier']['id']]['address'] = $this->address_format($supplier['Supplier']['address'], $supplier['Supplier']['city'], $supplier['Supplier']['province'], $supplier['Supplier']['country'], $supplier['Supplier']['postal_code']);
         $tmp_suplliers[$supplier['Supplier']['id']]['phone'] = $this->phone_format($supplier['Supplier']['phone'], $supplier['Supplier']['phone_ext'], $supplier['Supplier']['cell'], $supplier['Supplier']['fax_number']);
     }
     return $tmp_suplliers;
 }
开发者ID:khaled-saiful-islam,项目名称:zen_v1.0,代码行数:20,代码来源:QuoteItemComponent.php


示例18: run

 public function run()
 {
     // Initialize empty array
     $supplier = array();
     $date = new DateTime();
     $supplier[] = array('name' => 'New Egg', 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'));
     $supplier[] = array('name' => 'Microsoft', 'created_at' => $date->modify('-10 day'), 'updated_at' => $date->modify('-3 day'));
     // Delete all the old data
     DB::table('suppliers')->truncate();
     // Insert the new posts
     Supplier::insert($supplier);
 }
开发者ID:nahid,项目名称:snipe-it,代码行数:12,代码来源:SuppliersSeeder.php


示例19: postLoadSupplierProducts

 public function postLoadSupplierProducts()
 {
     if (Request::ajax()) {
         $post = Input::all();
         $supplier = Supplier::find($post['suppliersId']);
         if (!is_null($supplier)) {
             $products = $supplier->products()->orderBy('name')->get();
             return View::make('products.select')->with('products', $products)->render();
         } else {
             return Form::select('product', array('' => ' - Seleccione - '), null, array('class' => 'form-control', 'id' => 'product'));
         }
     }
 }
开发者ID:frankpaul142,项目名称:cloudinventory,代码行数:13,代码来源:ProductController.php


示例20: execute

 public function execute($job, $data)
 {
     $sup = Supplier::forge($data['id']);
     switch (\Arr::get($data, 'method', 'change')) {
         case 'update':
             $sup->update(\Arr::get($data, 'cached', false), \Arr::get($data, 'force', false));
             break;
         case 'change':
         default:
             $sup->change(\Arr::get($data, 'cached', false));
             break;
     }
 }
开发者ID:indigophp,项目名称:erp-stock-extra,代码行数:13,代码来源:supplier.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Support类代码示例发布时间:2022-05-23
下一篇:
PHP Summit类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap