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


PHP SplObjectStorage::contains方法代码示例

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


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

示例1: removeHandler

 /**
  * Remove the given log message handler if it is registered.
  * 
  * @param LogHandler $handler
  */
 public function removeHandler(LogHandler $handler)
 {
     if ($this->handlers->contains($handler)) {
         $this->handlers->detach($handler);
         $this->enabled = $this->handlers->count() ? true : false;
     }
 }
开发者ID:koolkode,项目名称:async,代码行数:12,代码来源:Logger.php

示例2: isVisiting

 public function isVisiting($object)
 {
     if (!is_object($object)) {
         return false;
     }
     return $this->visitingSet->contains($object);
 }
开发者ID:baardbaard,项目名称:bb-twitterfeed,代码行数:7,代码来源:SerializationContext.php

示例3: isVisiting

 public function isVisiting($object)
 {
     if (!is_object($object)) {
         throw new LogicException('Expected object but got ' . gettype($object) . '. Do you have the wrong @Type mapping or could this be a Doctrine many-to-many relation?');
     }
     return $this->visitingSet->contains($object);
 }
开发者ID:ygeneration666,项目名称:ma,代码行数:7,代码来源:SerializationContext.php

示例4: findConnection

 /**
  * @param AbstractSQLConnection $connection
  *
  * @return bool
  */
 public function findConnection(AbstractSQLConnection $connection)
 {
     if ($this->storage->contains($connection)) {
         return true;
     }
     return false;
 }
开发者ID:chilimatic,项目名称:database-component,代码行数:12,代码来源:MySQLConnectionStorage.php

示例5: removeComparison

 /**
  * Removes the given comparison
  *
  * @param PropertyComparisonInterface $comparison
  * @throws Exception\InvalidComparisonException if the given comparison is not in the list
  * @return $this
  */
 public function removeComparison($comparison)
 {
     if (!$this->comparisons->contains($comparison)) {
         throw new InvalidComparisonException('Can not remove given comparison because it is not in the list', 1409600320);
     }
     $this->comparisons->detach($comparison);
 }
开发者ID:marviktintor,项目名称:pos-1,代码行数:14,代码来源:Filter.php

示例6: getBlockId

 protected function getBlockId(Block $block)
 {
     if (!$this->blocks->contains($block)) {
         $this->blocks[$block] = count($this->blocks) + 1;
     }
     return $this->blocks[$block];
 }
开发者ID:ircmaxell,项目名称:php-cfg,代码行数:7,代码来源:DebugVisitor.php

示例7: removeValidator

 /**
  * Removes the specified validator.
  *
  * @param \TYPO3\FLOW3\Validation\Validator\ValidatorInterface $validator The validator to remove
  * @throws \TYPO3\FLOW3\Validation\Exception\NoSuchValidatorException
  * @api
  */
 public function removeValidator(\TYPO3\FLOW3\Validation\Validator\ValidatorInterface $validator)
 {
     if (!$this->validators->contains($validator)) {
         throw new \TYPO3\FLOW3\Validation\Exception\NoSuchValidatorException('Cannot remove validator because its not in the conjunction.', 1207020177);
     }
     $this->validators->detach($validator);
 }
开发者ID:nxpthx,项目名称:FLOW3,代码行数:14,代码来源:AbstractCompositeValidator.php

示例8: attachHandler

 /**
  * @return \Nano\Event\Manager
  * @param \Nano\Event\Handler $handler
  */
 public function attachHandler(\Nano\Event\Handler $handler)
 {
     if ($this->handlers->contains($handler)) {
         return $this;
     }
     $this->handlers->attach($handler);
     return $this;
 }
开发者ID:visor,项目名称:nano,代码行数:12,代码来源:Manager.php

示例9: addListener

 /**
  * @inheritDoc
  */
 public function addListener(ListenerInterface ...$listeners)
 {
     foreach ($listeners as $listener) {
         if (!$this->listeners->contains($listener)) {
             $this->listeners->attach($listener);
         }
     }
 }
开发者ID:oqq,项目名称:minc-event,代码行数:11,代码来源:Dispatcher.php

示例10: detach

 /**
  * Detach a autoloadiable
  *
  * @param \Attw\Autoloader\AutoloadableInterface
  */
 public function detach(AutoloadableInterface $autoloadable)
 {
     if (!$this->autoloadables->contains($autoloadable)) {
         throw new \Exception('The autoload hasn\'t been duplicated');
     }
     $this->autoloadables->detach($autoloadable);
     spl_autoload_unregister($autoloadable->getCallable());
 }
开发者ID:attwframework,项目名称:framework,代码行数:13,代码来源:Autoloader.php

示例11: add

 /**
  * @param FormInterface $child
  * @return FormInterface
  */
 public function add(FormInterface $child)
 {
     if (FALSE === $this->children->contains($child)) {
         $this->children->attach($child);
         $child->setParent($this);
     }
     return $this;
 }
开发者ID:busynoggin,项目名称:flux,代码行数:12,代码来源:AbstractFormContainer.php

示例12: getLocale

  /**
   * {@inheritdoc}
   */
  public function getLocale() {
    $request = $this->requestStack->getCurrentRequest();
    if (!$this->locales->contains($request)) {
      $this->locales[$request] = $this->chainResolver->resolve();
    }

    return $this->locales[$request];
  }
开发者ID:housineali,项目名称:drpl8_dv,代码行数:11,代码来源:LocaleContext.php

示例13: addDefaultScope

 /**
  * Adds scope to default scopes
  *
  * @param IScope $scope
  */
 public function addDefaultScope(IScope $scope)
 {
     if (!$this->defaultScopes->contains($scope)) {
         $this->defaultScopes->attach($scope);
     } else {
         throw new \InvalidArgumentException("Scope '{$scope->getId()}' is already registered as default scope.");
     }
 }
开发者ID:michalkvasnicak,项目名称:oauth2-server,代码行数:13,代码来源:ScopeResolver.php

示例14: removeBackend

 /**
  * Runs the close() method of a backend and removes the backend
  * from the logger.
  *
  * @param Backend\BackendInterface $backend The backend to remove
  * @return void
  * @throws NoSuchBackendException if the given backend is unknown to this logger
  * @api
  */
 public function removeBackend(Backend\BackendInterface $backend)
 {
     if (!$this->backends->contains($backend)) {
         throw new NoSuchBackendException('Backend is unknown to this logger.', 1229430381);
     }
     $backend->close();
     $this->backends->detach($backend);
 }
开发者ID:cerlestes,项目名称:flow-development-collection,代码行数:17,代码来源:Logger.php

示例15: fetch

 /**
  * @param Peer $peer
  * @return PeerState
  */
 public function fetch(Peer $peer)
 {
     if (!$this->storage->contains($peer)) {
         $state = $this->createState($peer);
     } else {
         $state = $this->storage->offsetGet($peer);
     }
     return $state;
 }
开发者ID:sbwdlihao,项目名称:node-php,代码行数:13,代码来源:PeerStateCollection.php


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