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


PHP SplObjectStorage::getInfo方法代码示例

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


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

示例1: onSubscriptionStateChange

 /**
  * Triggers PERSIST_INPUT_ERROR events for all currently active inputs
  */
 public function onSubscriptionStateChange()
 {
     foreach ($this->_inputErrorCollection as $input) {
         /* @var Input $input */
         $this->handleInputErrors($input, $this->_inputErrorCollection->getInfo());
     }
 }
开发者ID:Jalle19,项目名称:tvheadend-status-manager,代码行数:10,代码来源:InputErrorManager.php

示例2: refreshQueue

 /**
  * 刷新监听者队列
  */
 protected function refreshQueue()
 {
     $this->storage->rewind();
     $this->queue = new \SplPriorityQueue();
     foreach ($this->storage as $listener) {
         $priority = $this->storage->getInfo();
         $this->queue->insert($listener, $priority);
     }
 }
开发者ID:slince,项目名称:event,代码行数:12,代码来源:ListenerPriorityQueue.php

示例3: getAllFiles

 /**
  * @return RangeFile[]
  */
 private function getAllFiles()
 {
     $all = [];
     $this->map->rewind();
     while ($this->map->valid() === true) {
         array_push($all, $this->map->getInfo());
         $this->map->next();
     }
     return $all;
 }
开发者ID:nick-jones,项目名称:php-ucd,代码行数:13,代码来源:RangeFiles.php

示例4: findByName

 /**
  * @param   string    $name
  * @return  bool|ConfigurationInterface
  */
 protected function findByName($name)
 {
     $this->connections->rewind();
     while ($this->connections->valid()) {
         if ($this->connections->getInfo() === $name) {
             return $this->connections->current();
         }
         $this->connections->next();
     }
     return false;
 }
开发者ID:pbergman,项目名称:beanstalk-bundle,代码行数:15,代码来源:Manager.php

示例5: all

 /**
  * @param array $categories
  *
  * @return HandlerInterface[]
  */
 public function all(array $categories = array())
 {
     $handlers = array();
     foreach ($this->handlers as $handler) {
         $handlerCategories = $this->handlers->getInfo();
         if (array() === $categories || array() !== array_intersect($handlerCategories, $categories)) {
             $handlers[] = $handler;
         }
     }
     return $handlers;
 }
开发者ID:prgtw,项目名称:error-handler,代码行数:16,代码来源:HandlerManager.php

示例6: remove

 /**
  * 删除一个监听器
  * @param $listener
  * @return $this
  */
 public function remove($listener)
 {
     if ($this->has($listener)) {
         $this->store->detach($listener);
         $this->store->rewind();
         $queue = new \SplPriorityQueue();
         foreach ($this->store as $listener) {
             // 优先级
             $priority = $this->store->getInfo();
             $queue->insert($listener, $priority);
         }
         $this->queue = $queue;
     }
     return $this;
 }
开发者ID:inhere,项目名称:php-librarys,代码行数:20,代码来源:ListenersQueue.php

示例7: getControlEntityClass

 /**
  * @param \Nette\Forms\IControl|\Nette\Forms\Controls\BaseControl $control
  *
  * @return object
  */
 protected function getControlEntityClass(Nette\Forms\IControl $control)
 {
     foreach ($this->entities as $entity) {
         if ($this->entities->getInfo() === $control->getParent()) {
             return $this->getTargetClassName($entity, $this->getControlField($control));
         }
     }
     return NULL;
 }
开发者ID:svobodni,项目名称:web,代码行数:14,代码来源:EntityMapper.php

示例8: eventsToPublish

 private function eventsToPublish()
 {
     $events = array();
     $this->eventsToPublish->rewind();
     while ($this->eventsToPublish->valid()) {
         $events = array_merge($events, $this->eventsToPublish->getInfo());
         $this->eventsToPublish->next();
     }
     return $events;
 }
开发者ID:fcm,项目名称:GovernorFramework,代码行数:10,代码来源:DefaultUnitOfWork.php

示例9: commit

 /**
  * @param null|mixed|array $models (optional)
  */
 public function commit($models = null)
 {
     $pool = $this->manager->getPool();
     /** @var ObjectManager[] $managers */
     $managers = $pool->getIterator();
     if (null === $models) {
         foreach ($managers as $manager) {
             $manager->flush();
         }
         if (!$this->models->count()) {
             return;
         }
         $this->models->rewind();
         while ($this->models->valid()) {
             $model = $this->models->current();
             $class = $this->manager->getClassMetadata(get_class($model));
             $managerName = $class->getManagerReferenceGenerator();
             $ref = call_user_func(array($model, 'get' . ucfirst($managerName)));
             $id = call_user_func(array($ref, 'get' . ucfirst($class->getIdentifierReference($managerName)->referenceField)));
             foreach ($this->models->getInfo() as $managerName) {
                 $this->saveSpecificModel($model, $managerName, $id);
             }
             $this->models->next();
         }
         // clear list
         $this->models = new \SplObjectStorage();
     } else {
         if (!is_array($models)) {
             $models = array($models);
         }
         foreach ($models as $model) {
             $class = $this->manager->getClassMetadata(get_class($model));
             $managerName = $class->getManagerReferenceGenerator();
             $ref = call_user_func(array($model, 'get' . ucfirst($managerName)));
             $pool->getManager($managerName)->flush($ref);
             $id = call_user_func(array($ref, 'get' . ucfirst($class->getIdentifierReference($managerName)->referenceField)));
             foreach ($class->getFieldManagerNames() as $managerName) {
                 $this->saveSpecificModel($model, $managerName, $id);
             }
         }
     }
 }
开发者ID:pokap,项目名称:pool-dbm,代码行数:45,代码来源:UnitOfWork.php

示例10: run

 /**
  * Run current callback in the pipeline.
  *
  * @param $initial
  * @param $carry
  * @return mixed
  */
 private function run($initial, $carry)
 {
     /** @var callable $callback */
     $callback = $this->pipeline->current();
     /** @var array $args */
     $args = $this->pipeline->getInfo();
     array_unshift($args, $this->DTOs->top());
     array_unshift($args, $initial);
     array_unshift($args, $carry);
     return $this->maybeCast(call_user_func_array($callback, $args));
 }
开发者ID:toobo,项目名称:pipepie,代码行数:18,代码来源:Pipeline.php

示例11: getEdgeSet

 /**
  * Get the edges set
  *
  * @return Edge[]
  */
 public function getEdgeSet()
 {
     $set = array();
     foreach ($this->adjacency as $vertex) {
         $edgeList = $this->adjacency->getInfo();
         foreach ($edgeList as $item) {
             $set[] = $edgeList->getInfo();
         }
     }
     return $set;
 }
开发者ID:trismegiste,项目名称:mondrian,代码行数:16,代码来源:Digraph.php

示例12: castObjectStorage

 public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, $isNested)
 {
     $storage = array();
     unset($a[Caster::PREFIX_DYNAMIC . "gcdata"]);
     // Don't hit https://bugs.php.net/65967
     foreach ($c as $obj) {
         $storage[spl_object_hash($obj)] = array('object' => $obj, 'info' => $c->getInfo());
     }
     $a += array(Caster::PREFIX_VIRTUAL . 'storage' => $storage);
     return $a;
 }
开发者ID:EnmanuelCode,项目名称:backend-laravel,代码行数:11,代码来源:SplCaster.php

示例13: createParser

 public function createParser($name)
 {
     $signatures =& self::$signatures;
     $signatures = new \SplObjectStorage();
     $class = "class {$name} {\n" . "public \$length;\n" . 'public function parse($input) {' . '$this -> length = strlen($input);' . '$input .= "\\0";' . '$pos = 0;' . 'return [' . $this . ', $pos, $this -> length];' . "}\n";
     foreach ($signatures as $signature) {
         list($id, $code) = $signatures->getInfo();
         $class .= 'public function _' . $id . '($input, &$pos) {' . $code . '}' . "\n";
     }
     $class .= '}';
     return $class;
 }
开发者ID:dapepe,项目名称:tymio,代码行数:12,代码来源:parser_proto.php

示例14: getEigenVectorSparse

 /**
  * Return the dominant eigenvector of the adjacency matrix of
  * this graph
  *
  * @param float $precision
  * @return \SplObjectStorage
  */
 public function getEigenVectorSparse($precision = 0.001)
 {
     $vertex = $this->getVertexSet();
     $dimension = count($vertex);
     $approx = new \SplObjectStorage();
     foreach ($vertex as $v) {
         $approx[$v] = 1 / sqrt($dimension);
     }
     $iter = 0;
     do {
         // result = M . approx
         $result = new \SplObjectStorage();
         foreach ($vertex as $v) {
             $result[$v] = 0;
         }
         foreach ($vertex as $v) {
             foreach ($this->graph->getSuccessor($v) as $succ) {
                 $result[$v] += $approx[$succ];
                 // very suspicious
                 // what if we invert $v and $succ, isn't the reversed digraph ?
             }
         }
         // calc the norm
         $sum = 0;
         foreach ($result as $v) {
             $sum += $result->getInfo() * $result->getInfo();
         }
         $norm = sqrt($sum);
         $delta = 0;
         // normalize
         foreach ($result as $v) {
             $newVal = $norm > 0 ? $result->getInfo() / $norm : 0;
             $delta += abs($newVal - $approx[$v]);
             $approx[$v] = $newVal;
         }
         $iter++;
     } while ($delta > $precision && $iter < 2 * $dimension);
     return array('value' => $norm, 'vector' => $approx);
 }
开发者ID:trismegiste,项目名称:mondrian,代码行数:46,代码来源:PowerIteration.php

示例15: getSessionBySessionId

 /**
  * Get session by session ID
  *
  * @param int $sessionId
  * @return \Thruway\Session|boolean
  */
 public function getSessionBySessionId($sessionId)
 {
     /** @var Session $session */
     $this->sessions->rewind();
     while ($this->sessions->valid()) {
         $session = $this->sessions->getInfo();
         if ($session->getSessionId() == $sessionId) {
             return $session;
         }
         $this->sessions->next();
     }
     return false;
 }
开发者ID:pacho104,项目名称:redbpim,代码行数:19,代码来源:Router.php


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