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


PHP unknown::item方法代码示例

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


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

示例1: item

 /**
  * Return a specific item object by identifier
  * 
  * @param  string $itemIdentifier The unique item identifier
  * @return Item                   Item object
  */
 public function item($itemIdentifier)
 {
     return $this->store->item($itemIdentifier);
 }
开发者ID:rgnevashev,项目名称:cart,代码行数:10,代码来源:Cart.php

示例2: readFootprintFromGeolocationGridPoint

 /**
  * Reads Footprint from geolocation grid point
  * 
  * @param unknown $geolocationGridPoint
  * @param unknown $orbitDirection
  */
 private function readFootprintFromGeolocationGridPoint($geolocationGridPoint, $orbitDirection)
 {
     /*
      * On Ascending orbit, we are:
      * ll : pt(0, 0) i.e pixel 0, line 0 in geolocation grid point
      * lr : pt(max, 0)
      * ul : pt(0, max)
      * ur : pt(max, max),
      * 
      * On Descending orbit, we are:
      * ul : pt(0, 0) i.e pixel 0, line 0 in geolocation grid point
      * ur : pt(max, 0)
      * ll : pt(0, max)
      * lr : pt(max, max), 
      */
     $ll = array();
     $lr = array();
     $ul = array();
     $ur = array();
     $lineMax = 0;
     $lineMin = 0;
     $lineMinStatus = 0;
     $pixelMax = 0;
     for ($i = 0, $ii = $geolocationGridPoint->length; $i < $ii; $i++) {
         $line = (int) $geolocationGridPoint->item($i)->getElementsByTagName('line')->item(0)->nodeValue;
         $pixel = (int) $geolocationGridPoint->item($i)->getElementsByTagName('pixel')->item(0)->nodeValue;
         $coordinates = array($geolocationGridPoint->item($i)->getElementsByTagName('longitude')->item(0)->nodeValue, $geolocationGridPoint->item($i)->getElementsByTagName('latitude')->item(0)->nodeValue);
         if ($lineMinStatus == 0) {
             $lineMinStatus = 1;
             $lineMin = $line;
         }
         if ($line === $lineMin) {
             if ($pixel === 0) {
                 $ll = $coordinates;
             } else {
                 if ($pixel >= $pixelMax) {
                     $pixelMax = $pixel;
                     $lr = $coordinates;
                 }
             }
         } else {
             if ($line >= $lineMax) {
                 $lineMax = $line;
                 if ($pixel === 0) {
                     $ul = $coordinates;
                 } else {
                     if ($pixel >= $pixelMax) {
                         $pixelMax = $pixel;
                         $ur = $coordinates;
                     }
                 }
             }
         }
     }
     /*
      * On descending orbit, the North and South are inverted
      */
     if (strtolower($orbitDirection) === "descending") {
         /*
          * Temporary coordinates
          */
         $ll_ = $ll;
         $lr_ = $lr;
         $ur_ = $ur;
         $ul_ = $ul;
         /*
          * Inverts North and South
          */
         $lr = $ul_;
         $ll = $ur_;
         $ul = $lr_;
         $ur = $ll_;
     }
     $polygon = array($ll, $lr, $ur, $ul, $ll);
     return $polygon;
 }
开发者ID:rmourembles,项目名称:resto,代码行数:82,代码来源:RestoModel_S1_PEPS.php


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