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


PHP SplObjectStorage::offsetExists方法代码示例

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


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

示例1: invalidate

 public function invalidate(AbstractTerritoire $territoire)
 {
     $timestamp = $this->em->getRepository('AppBundle\\Repository\\CacheInfo\\TerritoireTimestamp')->findOneByTerritoire($territoire);
     if (!$timestamp && $this->toPersist->offsetExists($territoire)) {
         $timestamp = $this->toPersist[$territoire];
     }
     if ($timestamp) {
         $timestamp->setNow();
     }
     if (!$timestamp) {
         $timestamp = new TerritoireTimestamp($territoire);
         $this->em->persist($timestamp);
         $this->toPersist[$territoire] = $timestamp;
     }
     if ($territoire instanceof Commune) {
         $this->invalidate($territoire->getDepartement());
         return;
     }
     if ($territoire instanceof Departement) {
         $this->invalidate($territoire->getRegion());
         return;
     }
     if ($territoire instanceof Region && $territoire->getCirconscriptionEuropeenne()) {
         $this->invalidate($territoire->getCirconscriptionEuropeenne());
     }
     if ($territoire instanceof Region || $territoire instanceof CirconscriptionEuropeenne) {
         $this->invalidate($territoire->getPays());
     }
 }
开发者ID:AlexisEidelman,项目名称:dataelections.fr,代码行数:29,代码来源:DoctrineCacheInfoRepository.php

示例2: getByProperty

 /**
  * @param Property $property
  * @return AggregatorRelay
  * @throws UnexpectedValueException
  */
 public function getByProperty(Property $property)
 {
     if (!$this->map->offsetExists($property)) {
         throw new UnexpectedValueException();
     }
     return $this->map->offsetGet($property);
 }
开发者ID:nick-jones,项目名称:php-ucd,代码行数:12,代码来源:PropertyAggregators.php

示例3: setHelper

 /**
  * @param $helper
  *
  * @throws \AGmakonts\DddBricks\Repository\Exception\HelperException
  */
 private function setHelper(AbstractRepository $helper)
 {
     if (get_called_class() === $helper) {
         throw new HelperException(HelperException::HELPER_SELF_REFERENCING);
     }
     if (TRUE === $this->_helpers->offsetExists($helper->getEntityType())) {
         throw new HelperException(HelperException::HELPER_ALREADY_REQUESTED);
     }
     $this->_helpers->attach($helper->getEntityType(), $helper);
 }
开发者ID:agmakonts,项目名称:ddd-bricks,代码行数:15,代码来源:AbstractRepository.php

示例4: executeCommand

 /**
  * {@inheritdoc}
  */
 public function executeCommand(CommandInterface $command)
 {
     $this->storeCommand($command);
     $this->performExecution(function () use($command) {
         $priority = $command->getPriority();
         while (!empty($this->commands) && $this->commands[0]->getPriority() >= $priority) {
             $cmd = array_shift($this->commands);
             $this->commandResults[$cmd] = $cmd->execute($this);
             $this->executionCount++;
             if ($cmd === $command) {
                 // Bail out as soon as target command has been executed.
                 break;
             }
         }
         if ($this->executionDepth == 1) {
             // Execute remaining commands if this is a top level execution.
             while (!empty($this->commands)) {
                 $cmd = array_shift($this->commands);
                 $this->commandResults[$cmd] = $cmd->execute($this);
                 $this->executionCount++;
             }
         }
     });
     try {
         if ($this->commandResults->offsetExists($command)) {
             return $this->commandResults[$command];
         }
     } finally {
         if ($this->executionDepth == 0) {
             // Free command result memory after top level execution.
             $this->commandResults = new \SplObjectStorage();
         }
     }
 }
开发者ID:koolkode,项目名称:process,代码行数:37,代码来源:AbstractEngine.php

示例5: offsetExists

 /**
  * Whether a offset exists
  * @link http://php.net/manual/en/arrayaccess.offsetexists.php
  * @param mixed $offset <p>
  * An offset to check for.
  * </p>
  * @return boolean true on success or false on failure.
  * </p>
  * <p>
  * The return value will be casted to boolean if non-boolean was returned.
  * @since 5.0.0
  */
 public function offsetExists($offset)
 {
     if (is_scalar($offset)) {
         return array_key_exists($offset, $this->scalarStore);
     }
     if (is_object($offset)) {
         return $this->objectStore->offsetExists($offset);
     }
     if (is_array($offset)) {
         foreach ($this->arrayKeys as $index => $entry) {
             if ($entry === $offset) {
                 $this->lastArrayKey = $offset;
                 $this->lastArrayValue = $this->arrayValues[$index];
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:webonyx,项目名称:graphql-php,代码行数:31,代码来源:MixedStore.php

示例6: link

 public function link($model = NULL, $field = NULL, $reverse = FALSE)
 {
     var_dump('Link');
     if (!$model instanceof Yada_Model) {
         $field = $model;
         $model = $this->_model;
     }
     var_dump($field->name);
     $this->field($model, $field);
     $field = $this->_field;
     if (!$field instanceof Yada_Field_Interface_Related) {
         throw new Kohana_Exception('Field :name in Model :model isn\'t a Related Field', array(':name' => $field->name, ':model' => Yada::common_name('model', $model)));
     }
     $related = $field->related();
     if (!$this->_linked->offsetExists($field)) {
         $this->_linked[$field] = array($related, $reverse);
         $related->mapper->link($related->model, $related, TRUE);
     }
     return $related->model;
 }
开发者ID:jerfowler,项目名称:yada,代码行数:20,代码来源:core.php

示例7: offsetUnset

 public function offsetUnset($index)
 {
     $this->validateIndex($index);
     // Decrement counters when replacing existing item
     if (parent::offsetExists($index)) {
         $oldResult = parent::offsetGet($index);
         if ($oldResult instanceof Success) {
             $this->countSuccess--;
         } elseif ($oldResult instanceof Failure) {
             $this->countFailure--;
         } elseif ($oldResult instanceof Warning) {
             $this->countWarning--;
         } else {
             $this->countUnknown--;
         }
     }
     parent::offsetUnset($index);
 }
开发者ID:ralfeggert,项目名称:zftool,代码行数:18,代码来源:Collection.php

示例8: offsetExists

 public function offsetExists($object)
 {
     $this->initialize();
     return parent::offsetExists($object);
 }
开发者ID:patrickreck,项目名称:flow-development-collection,代码行数:5,代码来源:LazySplObjectStorage.php

示例9: offsetExists

 /**
  * @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
  */
 public function offsetExists($object)
 {
     @trigger_error('The ' . __METHOD__ . ' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
     return parent::offsetExists($object);
 }
开发者ID:0mars,项目名称:symfony,代码行数:8,代码来源:Crawler.php

示例10: offsetExists

 /**
  * @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
  */
 public function offsetExists($object)
 {
     $this->triggerDeprecation(__METHOD__);
     return parent::offsetExists($object);
 }
开发者ID:hudsonventura,项目名称:ModularCore,代码行数:8,代码来源:Crawler.php

示例11: offsetUnset

 /**
  * @param object $index
  * @link http://php.net/manual/en/splobjectstorage.offsetunset.php
  */
 public function offsetUnset($index)
 {
     $this->validateIndex($index);
     // Decrement counters when replacing existing item
     if (parent::offsetExists($index)) {
         $this->updateCounters(parent::offsetGet($index), -1);
     }
     parent::offsetUnset($index);
 }
开发者ID:riteshkmr33,项目名称:ovessnce,代码行数:13,代码来源:Collection.php

示例12: isSubscribed

 private function isSubscribed(WebSocketConnection $connection)
 {
     return $this->connectionTableMap->offsetExists($connection);
 }
开发者ID:proof,项目名称:blackjack-php-server,代码行数:4,代码来源:WebSocketManager.php

示例13: SplObjectStorage

$obj->setInfo('AAA');
// getInfo()
// 获得当前节点的值。也必须是调用rewind后,才可以调用getInfo。
$obj->getInfo();
// current()
// 获得当前节点对象
$obj->current();
// getHash()
// 获得参数的hash值
$obj->getHash($a2);
// next()
// 指针移到下一个节点
$obj->next();
// offsetExists
// 判断对象容器中是否存在该对象
$obj->offsetExists($a2);
// offsetSet()
// 给对象容器中的某个对象设置值
$obj->offsetSet($a2, 'BBB');
// offsetGet()
// 获得对象容器中的某个针对象对应的值
$obj->offsetGet($a2);
// offsetUnset()
// 将某节点删除
//$obj->offsetUnset($a1);
// serialize()
// 将对象容器序列化
$serialize_obj = $obj->serialize();
// unserialize()
// 将对象容器反序列化
$obj_2 = new SplObjectStorage();
开发者ID:ray0916,项目名称:learn,代码行数:31,代码来源:splObjectStorage.php

示例14: offsetExists

 /**
  * @param object $offset
  * @return bool
  */
 public function offsetExists($offset)
 {
     return $this->list->offsetExists($offset);
 }
开发者ID:davidbadura,项目名称:orangedb,代码行数:8,代码来源:ObjectCollection.php

示例15: _shouldIgnorePayment

 /**
  * return true if the payment should not be processed
  *
  * @param  Mage_Sales_Model_Order_Payment $payment
  * @param  SplObjectStorage               $processedPayments
  * @return bool
  */
 protected function _shouldIgnorePayment(Mage_Sales_Model_Order_Payment $payment, SplObjectStorage $processedPayments)
 {
     return $processedPayments->offsetExists($payment) || $payment->getMethod() === Mage::getModel('payment/method_free')->getCode();
 }
开发者ID:sirishreddyg,项目名称:magento-retail-order-management,代码行数:11,代码来源:Payment.php


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