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


PHP SplObjectStorage::current方法代码示例

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


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

示例1: hookUp

 /**
  * Registers all the field groups added
  * @author Tim Perry
  */
 public function hookUp()
 {
     $this->hookables->rewind();
     while ($this->hookables->valid()) {
         $hookable = $this->hookables->current();
         $hookable->hookUp();
         $this->hookables->next();
     }
 }
开发者ID:flexpress,项目名称:component-hooks,代码行数:13,代码来源:Hooker.php

示例2: execute

 public function execute(&$request, &$response)
 {
     if ($this->_filters->valid()) {
         /* @var $current Filter */
         $current = $this->_filters->current();
         $this->_filters->next();
         $current->execute($request, $response, $this);
     }
 }
开发者ID:hubvioos,项目名称:42framework,代码行数:9,代码来源:FilterChain.php

示例3: registerImageSizes

 /**
  *
  * Registers all the image sizes added
  *
  * @author Tim Perry
  *
  */
 public function registerImageSizes()
 {
     $this->sizes->rewind();
     while ($this->sizes->valid()) {
         $imageSize = $this->sizes->current();
         add_image_size($imageSize->getName(), $imageSize->getWidth(), $imageSize->getHeight(), $imageSize->getCrop());
         $this->sizes->next();
     }
 }
开发者ID:flexpress,项目名称:component-image-size,代码行数:16,代码来源:Helper.php

示例4: onEventProcessingFailed

 public function onEventProcessingFailed(array $eventMessages, \Exception $cause = null)
 {
     $this->delegates->rewind();
     while ($this->delegates->valid()) {
         $delegate = $this->delegates->current();
         $delegate->onEventProcessingFailed($eventMessages, $cause);
         $this->delegates->next();
     }
 }
开发者ID:fcm,项目名称:GovernorFramework,代码行数:9,代码来源:EventProcessingMonitorCollection.php

示例5: getTwig

 /**
  * Adds all the functions into the twig environment
  *
  * @param \Twig_Environment $twig
  * @return \Twig_Environment
  * @author Tim Perry
  */
 public function getTwig(\Twig_Environment $twig)
 {
     $this->functions->rewind();
     while ($this->functions->valid()) {
         $function = $this->functions->current();
         $twig->addFunction(new \Twig_SimpleFunction($function->getFunctionName(), array($function, 'getFunctionBody')));
         $this->functions->next();
     }
     return $twig;
 }
开发者ID:flexpress,项目名称:component-templating,代码行数:17,代码来源:Functions.php

示例6: registerShortcodes

 /**
  * Registers all shortcodes added
  * @author Tim Perry
  */
 public function registerShortcodes()
 {
     if (!function_exists('add_shortcode')) {
         return;
     }
     $this->shortcodes->rewind();
     while ($this->shortcodes->valid()) {
         $shortcode = $this->shortcodes->current();
         add_shortcode($shortcode->getName(), array($shortcode, 'getCallback'));
         $this->shortcodes->next();
     }
 }
开发者ID:flexpress,项目名称:component-shortcode,代码行数:16,代码来源:Helper.php

示例7: find

 /**
  * Iterates through user storage until certain $id is found.
  *
  * @param $id
  *
  * @return User
  *
  * @throws UserNotFoundException
  */
 public function find(UserId $id)
 {
     $this->users->rewind();
     while ($this->users->valid()) {
         $user = $this->users->current();
         if ($user->getId()->equals($id)) {
             return $user;
         }
         $this->users->next();
     }
     throw new UserNotFoundException(sprintf('User with id %d not found.', $id->id()));
 }
开发者ID:kolah,项目名称:recruitment,代码行数:21,代码来源:UserRepository.php

示例8: addMetaBoxes

 /**
  * Registers all the meta boxes added
  * @author Tim Perry
  */
 public function addMetaBoxes()
 {
     $this->metaBoxes->rewind();
     while ($this->metaBoxes->valid()) {
         $metaBox = $this->metaBoxes->current();
         foreach ($metaBox->getSupportedPostTypes() as $postType) {
             add_meta_box($metaBox->getID(), $metaBox->getTitle(), array($metaBox, 'getCallback'), $postType, $metaBox->getContext(), $metaBox->getPriority(), $metaBox->getCallbackArgs());
             add_action('save_post', array($metaBox, 'savePostCallback'));
         }
         $this->metaBoxes->next();
     }
 }
开发者ID:flexpress,项目名称:component-metabox,代码行数:16,代码来源:Helper.php

示例9: registerTaxonomies

 /**
  * Registers all the taxonomies added
  */
 public function registerTaxonomies()
 {
     if (!function_exists('register_taxonomy')) {
         return;
     }
     $this->taxonomies->rewind();
     while ($this->taxonomies->valid()) {
         $taxonomy = $this->taxonomies->current();
         register_taxonomy($taxonomy->getName(), $taxonomy->getSupportedPostTypes(), $taxonomy->getArgs());
         $this->taxonomies->next();
     }
 }
开发者ID:flexpress,项目名称:component-taxonomy,代码行数:15,代码来源:Helper.php

示例10: getConnectionByPosition

 /**
  * @param $pos
  *
  * @return null|AbstractSQLConnection
  */
 public function getConnectionByPosition($pos)
 {
     $pos = (int) $pos;
     $this->storage->rewind();
     for ($i = 0; $this->storage->count() > $i; $i++) {
         if ($i === $pos) {
             return $this->storage->current();
         }
         $this->storage->next();
     }
     return null;
 }
开发者ID:chilimatic,项目名称:database-component,代码行数:17,代码来源:MySQLConnectionStorage.php

示例11: registerPostTypes

 /**
  * Registers all the post types added
  * @author Tim Perry
  */
 public function registerPostTypes()
 {
     if (!function_exists('register_post_type')) {
         return;
     }
     $this->postTypes->rewind();
     while ($this->postTypes->valid()) {
         $postType = $this->postTypes->current();
         register_post_type($postType->getName(), $postType->getArgs());
         $this->postTypes->next();
     }
 }
开发者ID:flexpress,项目名称:component-post-type,代码行数:16,代码来源:Helper.php

示例12: registerFieldGroups

 /**
  * Registers all the field groups added
  *
  * @author Tim Perry
  */
 public function registerFieldGroups()
 {
     if (!function_exists('register_field_group')) {
         return;
     }
     $this->fieldGroups->rewind();
     while ($this->fieldGroups->valid()) {
         $field = $this->fieldGroups->current();
         register_field_group($field->getConfig());
         $this->fieldGroups->next();
     }
 }
开发者ID:flexpress,项目名称:component-acf,代码行数:17,代码来源:Helper.php

示例13: getNumberOfAdvancedCourses

 /**
  * @return int
  */
 public function getNumberOfAdvancedCourses() : int
 {
     $advancedCourses = 0;
     $this->courses->rewind();
     while ($this->courses->valid()) {
         $course = $this->courses->current();
         if ($course->isAdvanced()) {
             $advancedCourses++;
         }
         $this->courses->next();
     }
     return $advancedCourses;
 }
开发者ID:ionutcodreanu,项目名称:php-refactoring-examples,代码行数:16,代码来源:Person.php

示例14: postProcess

 /**
  * Runs after all steps have been processed bay calling post process method on all steps.
  *
  * @param \WCM\WPStarter\Setup\IO $io
  */
 public function postProcess(IO $io)
 {
     $this->postProcessSteps->rewind();
     while ($this->postProcessSteps->valid()) {
         /** @var \WCM\WPStarter\Setup\Steps\PostProcessStepInterface $step */
         $step = $this->postProcessSteps->current();
         $step->postProcess($io);
         $this->postProcessSteps->next();
     }
 }
开发者ID:GaryJones,项目名称:wpstarter,代码行数:15,代码来源:Stepper.php

示例15: 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


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