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


PHP self::append方法代码示例

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


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

示例1: createSelectStatement

 /**
  * Create a Select statement which returns the given array of rows.
  *
  * @param array $rows
  * @return Zend_Test_DbStatement
  */
 public static function createSelectStatement(array $rows = array())
 {
     $stmt = new self();
     foreach ($rows as $row) {
         $stmt->append($row);
     }
     return $stmt;
 }
开发者ID:bradley-holt,项目名称:zf2,代码行数:14,代码来源:DbStatement.php

示例2: toSubjected

 function toSubjected(ISubjectivity $object)
 {
     $me = new self();
     foreach ($this->toArray() as $elt) {
         $me->append($elt->toSubjected($object));
     }
     return $me;
 }
开发者ID:phoebius,项目名称:phoebius,代码行数:8,代码来源:OrderChain.class.php

示例3: denyFromAll

 /**
  * Create .htaccess and write 'Deny from all'
  *
  * @param Event $event Event
  *
  * @return null
  */
 public static function denyFromAll(Event $event)
 {
     $composer = $event->getComposer();
     $vendor = $composer->getConfig()->get("vendor-dir");
     $path = $vendor . "/.htaccess";
     $htaccess = new self($path);
     $htaccess->append("Deny from all");
     $composerIo = $event->getIO();
     $composerIo->write("File " . $path . " created, HTTP access denied");
 }
开发者ID:covex-nn,项目名称:moodle-installer,代码行数:17,代码来源:Htaccess.php

示例4: load

 /**
  * Load job
  *
  * @param string $id
  * @return bool|Job
  */
 public static function load($id)
 {
     $client = Kue::$instance->client;
     if (!($data = $client->hgetall('q:job:' . $id))) {
         return false;
     }
     $data['data'] = json_decode($data['data'], true);
     $job = new self($data['type'], null);
     $job->append($data);
     return $job;
 }
开发者ID:coderofsalvation,项目名称:php-kue,代码行数:17,代码来源:Job.php

示例5: find

 /**
  * Find list of nodes with a CSS selector
  *
  * @param string $selector
  * @param int    $idx
  *
  * @return SimpleHtmlDomNode|SimpleHtmlDomNode[]|null
  */
 public function find($selector, $idx = null)
 {
     $elements = new self();
     foreach ($this as $node) {
         foreach ($node->find($selector) as $res) {
             $elements->append($res);
         }
     }
     if (null === $idx) {
         return $elements;
     } else {
         if ($idx < 0) {
             $idx = count($elements) + $idx;
         }
     }
     return isset($elements[$idx]) ? $elements[$idx] : null;
 }
开发者ID:voku,项目名称:simple_html_dom,代码行数:25,代码来源:SimpleHtmlDomNode.php

示例6: loadArray

 public static function loadArray($A, &$widgets)
 {
     if (!$widgets instanceof self) {
         return false;
     }
     uasort($A, array('self', 'arraySort'));
     $result = new self();
     foreach ($A as $v) {
         if ($widgets->{$v['id']} != null) {
             $w = clone $widgets->{$v['id']};
             # Settings
             unset($v['id']);
             unset($v['order']);
             foreach ($v as $sid => $s) {
                 $w->{$sid} = $s;
             }
             $result->append($w);
         }
     }
     return $result;
 }
开发者ID:HackerMajor,项目名称:root,代码行数:21,代码来源:class.widgets.php

示例7: map

 /**
  * @param callable $fn ($item, int $i)
  * @return ResultSet
  */
 public function map($fn)
 {
     $i = 0;
     $resultSet = new self();
     foreach ($this as $key => $item) {
         $resultSet->append(call_user_func_array($fn, [$item, $i++]));
     }
     return $resultSet;
 }
开发者ID:serebro,项目名称:reach-common,代码行数:13,代码来源:ResultSet.php

示例8: pad

 public function pad($padchar, $padlen, $type = STR_PAD_LEFT)
 {
     if (self::$isMbstringLoaded) {
         $filllen = $padlen - $this->length();
         if ($filllen < 1) {
             return $this;
         } else {
             $padChar = new self($padchar);
             if ($type === STR_PAD_LEFT || $type === STR_PAD_RIGHT) {
                 if (($_len = $padChar->length()) === 1) {
                     $padChar->repeat($filllen);
                 } elseif ($_len !== $filllen) {
                     if ($filllen < $_len) {
                         $padChar->set($padChar->substring(0, $filllen));
                     } else {
                         $padChar->repeat(floor($filllen / $_len));
                         if (($rem = $filllen % $_len) !== 0) {
                             $padChar->append($padChar->substring(0, $rem));
                         }
                     }
                 }
                 if ($type === STR_PAD_LEFT) {
                     $this->string = $padChar . $this->string;
                 } else {
                     $this->string .= $padChar;
                 }
             } elseif ($type === STR_PAD_BOTH) {
                 $this->pad($padchar, (int) floor($filllen / 2) + $this->length(), STR_PAD_LEFT);
                 $this->pad($padchar, $padlen, STR_PAD_RIGHT);
             } else {
                 $message = __METHOD__ . "() invalid pad type. Use STR_PAD_LEFT or STR_PAD_RIGHT, STR_PAD_BOTH.";
                 throw new Sabel_Exception_InvalidArgument($message);
             }
         }
     } else {
         $this->string = str_pad($this->string, $padlen, $padchar, $type);
     }
     return $this;
 }
开发者ID:hamaco,项目名称:phwittr-on-xoops,代码行数:39,代码来源:String.php

示例9: merge

 /**
  * Merges this ItemPriceCollection with the given ItemPriceCollection to produce
  * a new ItemPriceCollection for ItemPrices that share a key.
  *
  * The resulting ItemPriceCollection is composed of ItemPrices as constructed by
  * the given comparator.
  *
  * Multiple items sharing the same key from the same collection are subject to
  * being merged multiple times in the order in which they appear in the collection.
  *
  * @param ItemPriceCollection $collection The collection to be merged
  * @param ItemComparatorInterface $comparator The comparator used to merge item prices
  */
 public function merge(ItemPriceCollection $collection, ItemComparatorInterface $comparator)
 {
     // Set a new collection for the merged results
     $price_collection = new self();
     foreach ($collection as $new_item) {
         foreach ($this as $current_item) {
             // Only items with matching non-null keys may be merged
             if ($current_item->key() !== null && $current_item->key() === $new_item->key() && ($item = $comparator->merge($current_item, $new_item))) {
                 $price_collection->append($item);
             }
         }
     }
     return $price_collection;
 }
开发者ID:blesta,项目名称:pricing,代码行数:27,代码来源:ItemPriceCollection.php

示例10: createFromContent

 /**
  * Creates a job list by the content of a crontab file
  *
  * @param string $content
  * @return \axy\crontab\JobList
  * @throws \axy\crontab\errors\InvalidJobString
  */
 public static function createFromContent($content)
 {
     $list = new self();
     foreach (explode("\n", $content) as $line) {
         $line = trim($line);
         if ($line === '') {
             continue;
         }
         if (substr($line, 0, 1) === '#') {
             continue;
         }
         $list->append($line);
     }
     return $list;
 }
开发者ID:axypro,项目名称:crontab,代码行数:22,代码来源:JobList.php

示例11: factory

 public static function factory($hours_string) {
   $tmp = new self();
   $hour_pieces = explode(' ', $hours_string);
   foreach($hour_pieces as $piece) {
     $tmp->append(self::hours_helper($piece));
   }
   return $tmp;
 }
开发者ID:ufwebadmin,项目名称:MIT-Mobile-Web,代码行数:8,代码来源:ShuttleSchedule.php

示例12: createFromTransition

 public static function createFromTransition(array $transition, $deduceRecurringRule = TRUE)
 {
     $date = new DateTime($transition['time'], new DateTimeZone('UTC'));
     $transitionRule = new self(array('isdst' => $transition['isdst'], 'offset' => $transition['offset'], 'abbr' => $transition['abbr'], 'from' => clone $date));
     if (!$deduceRecurringRule) {
         $transitionRule->addTransitionDate($date);
     } else {
         $transitionRule->append(array('month' => $date->format('n'), 'hour' => $date->format('G'), 'minute' => (int) $date->format('i'), 'second' => (int) $date->format('s'), 'wkday' => (int) $date->format('w'), 'numwk' => self::getNumWk($date)));
     }
     return $transitionRule;
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:11,代码来源:tzgen.php

示例13: fromNodeList

 /**
  * Swaps the current node list out for a given list.
  *
  * @param DomNodeList $list New list of nodes
  * @return DomQuery New instance
  */
 public static function fromNodeList(DomNodeList $list)
 {
     $q = new self();
     foreach ($list as $node) {
         $q->append($node);
     }
     return $q;
 }
开发者ID:elazar,项目名称:domquery,代码行数:14,代码来源:DOMQuery.php

示例14: filter

 /**
  * @param string|callable $selector css selector or callable
  *
  * @return Set
  */
 public function filter($selector)
 {
     $newSet = new self(array(), $this->ownerDocument);
     if (is_string($selector)) {
         foreach ($this as $node) {
             /** @var $node Attr|Element|Tag|Field|Text|Cdata|Comment */
             if ($node->is($selector)) {
                 $newSet->append($node);
             }
         }
     } else {
         if (is_callable($selector)) {
             foreach ($this as $index => $node) {
                 /** @var $node Attr|Element|Tag|Field|Text|Cdata|Comment */
                 if ($selector($node, $index)) {
                     $newSet->append($node);
                 }
             }
         } else {
             if ($selector instanceof \DOMNode) {
                 foreach ($this as $node) {
                     /** @var $node Attr|Element|Tag|Field|Text|Cdata|Comment */
                     if ($node->isSameNode($selector)) {
                         $newSet->append($node);
                     }
                 }
             }
         }
     }
     return $newSet;
 }
开发者ID:volux,项目名称:dom,代码行数:36,代码来源:Set.php


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