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


PHP unknown::getId方法代码示例

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


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

示例1: getOrRegister

 /**
  * 
  * @param unknown $user
  * @return ZfJoacubUsersOnline\Entity\Register
  */
 protected function getOrRegister($user)
 {
     if (isset($this->userRegister[$user->getId()])) {
         return $this->userRegister[$user->getId()];
     }
     $em = $this->sl->get('zf_joacub_users_online_doctrine_em');
     $em instanceof EntityManager;
     $repo = $em->getRepository('ZfJoacubUsersOnline\\Entity\\Register');
     $registerEntity = $repo->findOneBy(array('user' => $user));
     if (!$registerEntity) {
         $registerEntity = new Register();
         $registerEntity->setUser($user);
         $auth = $this->sl->get('zfcuser_auth_service');
         if ($auth->hasIdentity()) {
             if ($auth->getIdentity()->getId() == $user->getId()) {
                 $registerEntity->setLastConnect(new \DateTime('now'));
             } else {
                 $registerEntity->setLastConnect($user->getCreated());
             }
         }
         $registerEntity->setLastConnect($user->getCreated());
         $em->persist($registerEntity);
         $em->flush($registerEntity);
     }
     $this->userRegister[$user->getId()] = $registerEntity;
     return $registerEntity;
 }
开发者ID:joacub,项目名称:zf-joacub-users-online,代码行数:32,代码来源:UsersOnline.php

示例2: __construct

 /**
  * Constructs a new placeholder class and use the object to fill
  * the placeholder with.
  * 
  * @param unknown $object
  */
 public function __construct($object, $begin = "<<", $end = ">>")
 {
     $replace = array();
     if ($object instanceof Part) {
         $replace = array('id' => $object->getId(), 'barcodeId' => $object->getId() * 10 + 1, 'name' => $object->getName(), 'internalNumber' => $object->getInternalPartNumber(), 'description' => $object->getDescription(), 'categoryFull' => $object->getCategory()->getCategoryPath(), 'categoryLast' => $object->getCategory()->getName(), 'footprintName' => $object->getFootprint() === null ? '' : $object->getFootprint()->getName(), 'storageLocationName' => $object->getStorageLocation() === null ? '' : $object->getStorageLocation()->getName());
     } else {
         if ($object instanceof StorageLocation) {
             $replace = array('id' => $object->getId(), 'barcodeId' => $object->getId() * 10 + 2, 'name' => $object->getName());
         }
     }
     $this->beginToken = $begin;
     $this->endToken = $end;
     $this->replacements = $replace;
 }
开发者ID:JohnEffland,项目名称:PartKeepr,代码行数:20,代码来源:Placeholder.php

示例3: exportDeliveryAddress

 /**
  * Exports the delivery address
  */
 protected function exportDeliveryAddress()
 {
     if ($this->ShippingAddress === null) {
         return;
     }
     if ($this->PLENTY_customerID === null) {
         return;
     }
     $city = trim($this->ShippingAddress->getCity());
     $street_arr = PlentymarketsUtils::extractStreetAndHouseNo($this->ShippingAddress->getStreet());
     if (isset($street_arr['street']) && strlen($street_arr['street']) > 0) {
         $streetName = $street_arr['street'];
     } else {
         $streetName = trim($this->ShippingAddress->getStreet());
     }
     if (isset($street_arr['houseNo']) && strlen($street_arr['houseNo']) > 0) {
         $streetHouseNumber = $street_arr['houseNo'];
     } else {
         $streetHouseNumber = '';
     }
     $zip = trim($this->ShippingAddress->getZipCode());
     if (empty($city)) {
         $city = PlentymarketsConfig::getInstance()->get('CustomerDefaultCity');
     }
     if (!isset($streetHouseNumber) || $streetHouseNumber == '') {
         $streetHouseNumber = PlentymarketsConfig::getInstance()->get('CustomerDefaultHouseNumber');
     }
     if (!isset($streetName) || $streetName == '') {
         $streetName = PlentymarketsConfig::getInstance()->get('CustomerDefaultStreet');
     }
     if ($zip == '') {
         $zip = PlentymarketsConfig::getInstance()->get('CustomerDefaultZipcode');
     }
     $Request_SetCustomerDeliveryAddresses = new PlentySoapRequest_SetCustomerDeliveryAddresses();
     $Request_SetCustomerDeliveryAddresses->DeliveryAddresses = array();
     $Object_SetCustomerDeliveryAddressesCustomer = new PlentySoapRequest_ObjectSetCustomerDeliveryAddresses();
     $Object_SetCustomerDeliveryAddressesCustomer->AdditionalName = null;
     // string
     $Object_SetCustomerDeliveryAddressesCustomer->City = $city;
     $Object_SetCustomerDeliveryAddressesCustomer->Company = $this->ShippingAddress->getCompany();
     $Object_SetCustomerDeliveryAddressesCustomer->CountryID = $this->getDeliveryCountryID();
     // int
     $Object_SetCustomerDeliveryAddressesCustomer->CustomerID = $this->PLENTY_customerID;
     // int
     $Object_SetCustomerDeliveryAddressesCustomer->ExternalDeliveryAddressID = PlentymarketsUtils::getExternalCustomerID($this->ShippingAddress->getId());
     // string
     $Object_SetCustomerDeliveryAddressesCustomer->FirstName = $this->ShippingAddress->getFirstName();
     $Object_SetCustomerDeliveryAddressesCustomer->FormOfAddress = $this->getDeliveryFormOfAddress();
     // int
     $Object_SetCustomerDeliveryAddressesCustomer->HouseNumber = $streetHouseNumber;
     $Object_SetCustomerDeliveryAddressesCustomer->Street = $streetName;
     $Object_SetCustomerDeliveryAddressesCustomer->Surname = $this->ShippingAddress->getLastName();
     $Object_SetCustomerDeliveryAddressesCustomer->ZIP = $zip;
     $Request_SetCustomerDeliveryAddresses->DeliveryAddresses[] = $Object_SetCustomerDeliveryAddressesCustomer;
     $Response_SetCustomerDeliveryAddresses = PlentymarketsSoapClient::getInstance()->SetCustomerDeliveryAddresses($Request_SetCustomerDeliveryAddresses);
     if (!$Response_SetCustomerDeliveryAddresses->Success) {
         throw new PlentymarketsExportEntityException('The delivery address of the customer with the number »' . $this->getCustomerNumber() . '« could not be exported', 2120);
     }
     $this->PLENTY_addressDispatchID = (int) $Response_SetCustomerDeliveryAddresses->ResponseMessages->item[0]->SuccessMessages->item[0]->Value;
 }
开发者ID:pixolith,项目名称:plentymarkets-shopware-connector,代码行数:63,代码来源:PlentymarketsExportEntityCustomer.php

示例4: getProductCollectionByProduct

 /**
  * Get product collection for only one product
  * @param unknown $product
  * @param int $store_id
  */
 public function getProductCollectionByProduct($product, $store_id)
 {
     $collection = $this->getProductCollectionByStoreId($store_id);
     $collection->addAttributeToFilter('entity_id', array('in' => array($product->getId())));
     return $collection;
 }
开发者ID:shebin512,项目名称:Magento_Zoff,代码行数:11,代码来源:Ultility0805.php

示例5: getObjectId

 /**
  * Returns the object ID from the object
  *
  * @param unknown $object
  */
 protected function getObjectId($object)
 {
     return $object->getId();
 }
开发者ID:NandoKstroNet,项目名称:thelia,代码行数:9,代码来源:AddressController.php

示例6: getId

 /**
  * 返回当前新增ID
  */
 public function getId()
 {
     return $this->_db->getId();
 }
开发者ID:v3u3i87,项目名称:run_cli,代码行数:7,代码来源:Model.php

示例7: create

 /**
  * 
  * @param unknown $devis
  * @param unknown $town
  * @param unknown $day
  * @param unknown $address
  * @param unknown $startTime
  * @param unknown $message
  * @return boolean
  */
 public function create($devis, $town, $day, $address, $startTime, $duration, $message)
 {
     $client = $this->getCurrentUser();
     $town = $this->em->getRepository('MainCommonBundle:Geo\\Town')->findOneById($town);
     $address = $address;
     $status = $this->em->getRepository('MainCommonBundle:Status\\PrestationStatus')->findOneById(self::PRESTATION_ENCOURS);
     $devisPrice = $this->em->getRepository('MainCommonBundle:Photographers\\DevisPrices')->findOneBy(array('devis' => $devis->getId(), 'duration' => $duration));
     $duration = $devisPrice->getDuration();
     $price = $devisPrice->getPrice();
     $start = str_replace('/', '-', $day) . ' ' . $startTime . ':00';
     $startTime = new \DateTime($start);
     $commission = $this->serviceCommissionPrestation->generateCommission($devis);
     $prestation = new Prestation();
     $prestation->setReference($this->reference->generateReference());
     $prestation->setDevis($devis);
     $prestation->setRappel($devis->getPresentation());
     $prestation->setClient($client);
     $prestation->setTown($town);
     $prestation->setPrice($price);
     $prestation->setAddress($address);
     $prestation->setStartTime($startTime);
     $prestation->setDuration($duration);
     $prestation->setStatus($status);
     $prestation->setCommission($commission);
     try {
         $this->em->persist($prestation);
         $this->CreateMessage($prestation, $client, $devis->getCompany()->getPhotographer(), 1, $message);
         $this->em->flush();
         $this->mailer->prestationUpdateEmail($prestation);
         $this->notification->createPrestationNotification($prestation);
         return $prestation;
     } catch (\Exception $e) {
         $this->session->errorFlashMessage();
         $this->logger->error($e->getMessage());
         return false;
     }
 }
开发者ID:TheTypoMaster,项目名称:cheeese,代码行数:47,代码来源:ServicePrestation.php

示例8: build

 /**
  * (non-PHPdoc)
  *
  * @see \Core\Html\Bootstrap\Panel\Panel::build()
  *
  * @throws ControlException
  */
 public function build()
 {
     if (empty($this->form)) {
         throw new ControlException('Editbox control needs a set FormDesigner or Form object.');
     }
     // Editbox CSS class needed
     $this->panel->html->addCss('editbox');
     // Create panel heading with title
     $heading = $this->panel->createHeading();
     $title = $heading->createTitle();
     $title->setTitle($this->caption);
     if (!empty($this->description)) {
         $title->setDescription($this->description, true);
     }
     $heading->addContent($title);
     // Create panel body
     if ($this->form instanceof FormDesigner) {
         $form_id = $this->form->html->getId();
         $form_action = $this->form->html->getAttribute('action');
         // Ajax form?
         $this->is_ajax = $this->form->getSendMode() == 'ajax' ? true : false;
     } else {
         $form_id = $this->form->getId();
         $form_action = $this->form->getAttribute('action');
     }
     // Build form here because it's possible that form id will be autogenerated
     // and we need this id in the next step.
     $body = $this->panel->createBody();
     $body->addContent($this->form);
     // Footer with toolbar
     /* @var $toolbar \Core\Html\Bootstrap\Buttongroups\ButtonToolbar */
     $toolbar = $this->factory->create('Bootstrap\\Buttongroups\\ButtonToolbar');
     $create_action = function (Action $action, $with_link = false) {
         $text = $action->getText();
         $icon = $action->getIcon();
         if (!empty($icon)) {
             $text = $icon->build() . ' ' . $text;
         }
         if ($with_link) {
             $href = $action->getHref();
             if (!empty($href)) {
                 /* @var $a \Core\Html\Elements\A */
                 $a = $this->factory->create('Elements\\A');
                 $a->setHref($href);
                 if ($action->getAjax()) {
                     $a->addData('ajax');
                 }
                 if ($action->getConfirm()) {
                     $a->addData('confirm', $action->getConfirm());
                 }
                 $a->setInner($text);
                 $text = $a->build();
             }
         }
         return $text;
     };
     // Make sure that he buttons have the correct order
     ksort($this->actions);
     foreach ($this->actions as $type => $action) {
         switch ($type) {
             case 0:
             case 1:
                 /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
                 $group = $toolbar->createButtongroup();
                 $group->addCss('btn-group-sm');
                 switch ($type) {
                     case 0:
                         $button = $group->createButton();
                         $button->setFormId($form_id);
                         $button->setFormAction($form_action);
                         $button->isSuccess();
                         if ($this->is_ajax) {
                             $button->addData('ajax');
                         } else {
                             $button->setType('submit');
                         }
                         break;
                     case 1:
                         $group->addCss('pull-right');
                         /* @var $button \Core\Html\Controls\UiButton */
                         $button = $group->createButton('Controls\\UiButton');
                         $button->setHref($action->getHref());
                         $button->addCss('btn-danger');
                         if ($this->is_ajax) {
                             $button->addData('ajax');
                         }
                         break;
                 }
                 $button->setInner($create_action($this->actions[$type]));
                 break;
             case 2:
             default:
                 /* @var $group \Core\Html\Bootstrap\Buttongroups\ButtonGroup */
//.........这里部分代码省略.........
开发者ID:tekkla,项目名称:core-html,代码行数:101,代码来源:Editbox.php

示例9: getProductPrice

 /**
  * Get product price
  * @param unknown $_product
  * @param unknown $storeId
  * @return decimal
  */
 public function getProductPrice($_product, $storeId)
 {
     $_coreHelper = Mage::helper('core');
     $_weeeHelper = Mage::helper('weee');
     $_taxHelper = Mage::helper('tax');
     $_storeId = $_product->getStoreId();
     $_id = $_product->getId();
     $_weeeSeparator = '';
     $_simplePricesTax = $_taxHelper->displayPriceIncludingTax() || $_taxHelper->displayBothPrices();
     $_minimalPriceValue = $_product->getMinimalPrice();
     $_minimalPrice = $_taxHelper->getPrice($_product, $_minimalPriceValue, $_simplePricesTax);
     $returnPrice = $_product->getFinalPrice();
     if ($_product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_BUNDLE) {
         return $_product->getMinimalPrice();
     }
     if (!$_product->isGrouped()) {
         $_weeeTaxAmount = $_weeeHelper->getAmountForDisplay($_product);
         if ($_weeeHelper->typeOfDisplay($_product, array(Mage_Weee_Model_Tax::DISPLAY_INCL_DESCR, Mage_Weee_Model_Tax::DISPLAY_EXCL_DESCR_INCL, 4))) {
             $_weeeTaxAmount = $_weeeHelper->getAmount($_product);
             $_weeeTaxAttributes = $_weeeHelper->getProductWeeeAttributesForDisplay($_product);
         }
         $_weeeTaxAmountInclTaxes = $_weeeTaxAmount;
         if ($_weeeHelper->isTaxable() && !$_taxHelper->priceIncludesTax($_storeId)) {
             $_attributes = $_weeeHelper->getProductWeeeAttributesForRenderer($_product, null, null, null, true);
             $_weeeTaxAmountInclTaxes = $_weeeHelper->getAmountInclTaxes($_attributes);
         }
         $_price = $_taxHelper->getPrice($_product, $_product->getPrice());
         $_regularPrice = $_taxHelper->getPrice($_product, $_product->getPrice(), $_simplePricesTax);
         $_finalPrice = $_taxHelper->getPrice($_product, $_product->getFinalPrice());
         $_finalPriceInclTax = $_taxHelper->getPrice($_product, $_product->getFinalPrice(), true);
         $_weeeDisplayType = $_weeeHelper->getPriceDisplayType();
         if ($_finalPrice >= $_price) {
             if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)) {
                 $returnPrice = $_price + $_weeeTaxAmount;
             } else {
                 if ($_finalPrice == $_price) {
                     $returnPrice = $_price;
                 } else {
                     $returnPrice = $_finalPrice;
                 }
             }
         } else {
             $_originalWeeeTaxAmount = $_weeeHelper->getOriginalAmount($_product);
             if ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 0)) {
                 $returnPrice = $_regularPrice + $_originalWeeeTaxAmount;
             } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 1)) {
                 $returnPrice = $_regularPrice + $_originalWeeeTaxAmount;
             } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 4)) {
                 $returnPrice = $_regularPrice + $_originalWeeeTaxAmount;
             } elseif ($_weeeTaxAmount && $_weeeHelper->typeOfDisplay($_product, 2)) {
                 $returnPrice = $_regularPrice;
             } else {
                 $returnPrice = $_finalPriceInclTax;
             }
         }
     } else {
         $_exclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue);
         $_inclTax = $_taxHelper->getPrice($_product, $_minimalPriceValue, true);
         if ($_minimalPriceValue) {
             $_showPrice = $_inclTax;
             if (!$_taxHelper->displayPriceIncludingTax()) {
                 $_showPrice = $_exclTax;
             }
             $returnPrice = $_showPrice;
         }
     }
     return $returnPrice;
 }
开发者ID:jokusafet,项目名称:MagentoSource,代码行数:74,代码来源:Ultility.php

示例10: getId

 /**
  * 返回当前新增ID
  */
 protected function getId()
 {
     return $this->_db->getId();
 }
开发者ID:v3u3i87,项目名称:upadd,代码行数:7,代码来源:Query.php


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