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


PHP static::add方法代码示例

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


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

示例1: fromString

 /**
  * Parse a query string into a Query object
  *
  * @param string $query Query string to parse
  *
  * @return self
  */
 public static function fromString($query)
 {
     $q = new static();
     if ($query === '') {
         return $q;
     }
     $foundDuplicates = $foundPhpStyle = false;
     foreach (explode('&', $query) as $kvp) {
         $parts = explode('=', $kvp, 2);
         $key = rawurldecode($parts[0]);
         if ($paramIsPhpStyleArray = substr($key, -2) == '[]') {
             $foundPhpStyle = true;
             $key = substr($key, 0, -2);
         }
         if (isset($parts[1])) {
             $value = rawurldecode(str_replace('+', '%20', $parts[1]));
             if (isset($q[$key])) {
                 $q->add($key, $value);
                 $foundDuplicates = true;
             } elseif ($paramIsPhpStyleArray) {
                 $q[$key] = array($value);
             } else {
                 $q[$key] = $value;
             }
         } else {
             $q->add($key, null);
         }
     }
     // Use the duplicate aggregator if duplicates were found and not using
     // PHP style arrays.
     if ($foundDuplicates && !$foundPhpStyle) {
         $q->setAggregator(self::duplicateAggregator());
     }
     return $q;
 }
开发者ID:helsaba,项目名称:rainloop-webmail,代码行数:42,代码来源:Query.php

示例2: fromString

 /**
  * Parse a query string into a QueryString object
  *
  * @param string $query Query string to parse
  *
  * @return self
  */
 public static function fromString($query)
 {
     $q = new static();
     if (0 !== strlen($query)) {
         if ($query[0] == '?') {
             $query = substr($query, 1);
         }
         foreach (explode('&', $query) as $kvp) {
             $parts = explode('=', $kvp, 2);
             $key = rawurldecode($parts[0]);
             $paramIsPhpStyleArray = substr($key, -2) == '[]';
             if ($paramIsPhpStyleArray) {
                 $key = substr($key, 0, -2);
             }
             if (array_key_exists(1, $parts)) {
                 $value = rawurldecode(str_replace('+', '%20', $parts[1]));
                 if ($paramIsPhpStyleArray && !$q->hasKey($key)) {
                     $value = array($value);
                 }
                 $q->add($key, $value);
             } else {
                 $q->add($key, '');
             }
         }
     }
     return $q;
 }
开发者ID:creazy412,项目名称:vmware-win10-c65-drupal7,代码行数:34,代码来源:QueryString.php

示例3: request

 public static function request()
 {
     $class = new static();
     !Input::has('deleteShippingMethod') ?: $class->delete(Input::get('deleteShippingMethod'));
     !Input::has('updateShippingMethod') ?: $class->update(Input::get('updateShippingMethod'))->with(Input::get('shipping.fill'));
     !Input::has('addShippingMethod') ?: $class->add()->with(Input::get('shipping.fill'));
 }
开发者ID:artemsk,项目名称:veer-core,代码行数:7,代码来源:Shipping.php

示例4: nextWorkingDay

 private function nextWorkingDay($current)
 {
     if ($current->format('H') < 19 && !$this->isSunday($current) && !$this->isWeekend($current) && !$this->isHoliday($current)) {
         $next = new static($current->format('Y-m-d ' . static::DEFAULT_OFFICE_CLOSE_TIME), $this->timezone);
     } else {
         $next = new static($current->format('Y-m-d ' . static::DEFAULT_OFFICE_CALL_TIME), $this->timezone);
         $i = 0;
         // We have 0 future dates to start with
         while ($i < 1) {
             $next->add(new DateInterval('P1D'));
             // Add 1 day
             if ($this->isHoliday($next)) {
                 continue;
             }
             // Don't include year to ensure the check is year independent
             // Note that you may need to do more complicated things for special holidays that don't use specific dates like "the last Friday of this month"
             if ($this->isWeekend($next)) {
                 continue;
             }
             // These next lines will only execute if continue isn't called for this iteration
             $i++;
         }
     }
     return $next;
 }
开发者ID:ravikumar8,项目名称:response,代码行数:25,代码来源:Response.php

示例5: request

 public static function request()
 {
     $class = new static();
     $class->acton = Input::get('action');
     !Input::has('deleteSearch') ?: $class->delete(Input::get('deleteSearch'));
     $class->action != 'addSearch' ?: $class->add(Input::get('search'), Input::get('users'));
 }
开发者ID:artemsk,项目名称:veer-core,代码行数:7,代码来源:Search.php

示例6: fromFileScan

 /**
  * @ignore
  */
 public static function fromFileScan($uPattern)
 {
     $tSep = quotemeta(DIRECTORY_SEPARATOR);
     $tPos = strrpos($uPattern, $tSep);
     if ($tSep !== '/' && $tPos === false) {
         $tSep = '/';
         $tPos = strrpos($uPattern, $tSep);
     }
     if ($tPos !== false) {
         $tPattern = substr($uPattern, $tPos + strlen($tSep));
         $tPath = substr($uPattern, 0, $tPos + strlen($tSep));
     } else {
         $tPath = $uPattern;
         $tPattern = "";
     }
     $tTemp = new static();
     $tHandle = new \DirectoryIterator($tPath);
     $tPatExists = strlen($uPattern) > 0;
     for (; $tHandle->valid(); $tHandle->next()) {
         if (!$tHandle->isFile()) {
             continue;
         }
         $tFile = $tHandle->current();
         if ($tPatExists && !fnmatch($tPattern, $tFile)) {
             continue;
         }
         $tTemp->add($tPath . $tFile);
     }
     return $tTemp;
 }
开发者ID:eserozvataf,项目名称:scabbia1,代码行数:33,代码来源:FileCollection.php

示例7: request

 public static function request()
 {
     $class = new static();
     Input::get('action') != 'addComment' ?: $class->add(Input::all());
     !Input::has('hideComment') ?: $class->hide(head(Input::get('hideComment', [])));
     !Input::has('unhideComment') ?: $class->unhide(head(Input::get('unhideComment', [])));
     !Input::has('deleteComment') ?: $class->delete(head(Input::get('deleteComment', [])));
 }
开发者ID:artemsk,项目名称:veer-core,代码行数:8,代码来源:Comment.php

示例8: forType

 /**
  * @param string $type_
  *
  * @return \Components\Object_Properties
  */
 public static function forType($type_)
 {
     $instance = new static($type_);
     foreach (self::arrayForType($type_) as $property) {
         $instance->add($property['name'], $property['type'], $property['nameMapped'], $property['typeMapped']);
     }
     return $instance;
 }
开发者ID:evalcodenet,项目名称:net.evalcode.components.object,代码行数:13,代码来源:properties.php

示例9: fromArray

 /**
  * @param array $strings
  *
  * @return static
  */
 public static function fromArray(array $strings)
 {
     $list = new static();
     foreach ($strings as $oneString) {
         $list->add($oneString);
     }
     return $list;
 }
开发者ID:hansel23,项目名称:strongly-typed,代码行数:13,代码来源:StringList.php

示例10: createFailure

 /**
  * convenience method to create a simple failure report
  * 
  * @param string $message
  * @param mixed $errors
  * @return common_report_Report
  */
 public static function createFailure($message, $errors = array())
 {
     $report = new static(self::TYPE_ERROR, $message);
     foreach ($errors as $error) {
         $report->add($error);
     }
     return $report;
 }
开发者ID:nagyist,项目名称:generis,代码行数:15,代码来源:class.Report.php

示例11: fromConfig

 public static function fromConfig($config)
 {
     $collection = new static();
     foreach ($config as $key => $config) {
         $collection->add($key, $config);
     }
     return $collection;
 }
开发者ID:vespakoen,项目名称:bolt-core,代码行数:8,代码来源:ExtensionCollection.php

示例12: build

 /**
  * A handy starter for creating a button group with buttons.
  * @param array $buttons
  * @return ButtonGroup
  */
 public static function build(array $buttons = [])
 {
     $group = new static();
     foreach ($buttons as $button) {
         $group->add($button);
     }
     return $group;
 }
开发者ID:breachofmind,项目名称:birdmin,代码行数:13,代码来源:ButtonGroup.php

示例13: getCommandResult

 /**
  * @param  CommandInterface $cmd
  * @return ResponseCollection
  */
 public function getCommandResult(CommandInterface $cmd)
 {
     $collection = new static();
     foreach (new ResponseFilterIterator($this, $cmd) as $response) {
         $collection->add($response);
     }
     return $collection;
 }
开发者ID:mahadazad,项目名称:event-manager,代码行数:12,代码来源:ResponseCollection.php

示例14: fromXml

 /**
  * Construct the result based on the given xml.
  * @param SimpleXMLElement $xmlElement
  * @return \CultuurNet\Search\SuggestionsResult
  */
 public static function fromXml(SimpleXMLElement $xmlElement)
 {
     $result = new static();
     foreach ($xmlElement->xpath('//suggestion') as $xmlSuggestion) {
         $result->add(SuggestionsItem::fromXml($xmlSuggestion));
     }
     return $result;
 }
开发者ID:cultuurnet,项目名称:search,代码行数:13,代码来源:SuggestionsResult.php

示例15: createRandomProducts

 public static function createRandomProducts($numberOfProducts = 1)
 {
     $collection = new static();
     for ($i = $numberOfProducts; $i > 0; $i--) {
         $collection->add(new Product());
     }
     return $collection;
 }
开发者ID:jayveloper,项目名称:fcontrol,代码行数:8,代码来源:ProductCollection.php


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