本文整理汇总了PHP中SplObjectStorage::setInfo方法的典型用法代码示例。如果您正苦于以下问题:PHP SplObjectStorage::setInfo方法的具体用法?PHP SplObjectStorage::setInfo怎么用?PHP SplObjectStorage::setInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SplObjectStorage
的用法示例。
在下文中一共展示了SplObjectStorage::setInfo方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: clearAllCaches
public static function clearAllCaches()
{
self::clearCache();
self::$__caches->rewind();
while (self::$__caches->valid()) {
self::$__caches->setInfo([]);
self::$__caches->next();
}
}
示例2: publishEvents
/**
* Publishes all registered events to their respective event bus.
*/
protected function publishEvents()
{
$this->logger->debug("Publishing events to the event bus");
if ($this->dispatcherStatus == self::STATUS_DISPATCHING) {
// this prevents events from overtaking each other
$this->logger->debug("UnitOfWork is already in the dispatch process. " . "That process will publish events instead. Aborting...");
return;
}
$this->dispatcherStatus = self::STATUS_DISPATCHING;
$this->eventsToPublish->rewind();
while ($this->eventsToPublish->valid()) {
$bus = $this->eventsToPublish->current();
$events = $this->eventsToPublish->getInfo();
foreach ($events as $event) {
$this->logger->debug("Publishing event [{event}] to event bus [{bus}]", array('event' => $event->getPayloadType(), 'bus' => get_class($bus)));
}
// clear and send
$this->eventsToPublish->setInfo(array());
$bus->publish($events);
$this->eventsToPublish->next();
}
$this->logger->debug("All events successfully published.");
$this->dispatcherStatus = self::STATUS_READY;
}
示例3: setInfo
public function setInfo($data)
{
$this->initialize();
parent::setInfo($data);
}
示例4: setInfo
/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function setInfo($data)
{
@trigger_error('The ' . __METHOD__ . ' method is deprecated as of 2.8 and will be removed in 3.0.', E_USER_DEPRECATED);
parent::setInfo($data);
}
示例5: setInfo
/**
* @deprecated Using the SplObjectStorage API on the Crawler is deprecated as of 2.8 and will be removed in 3.0.
*/
public function setInfo($data)
{
$this->triggerDeprecation(__METHOD__);
parent::setInfo($data);
}
示例6: SplObjectStorage
<?php
$s = new SplObjectStorage();
var_dump($s->setInfo('some_value'));
示例7:
// false
// count()
// 获得映射对象中的对象数量
$obj->count();
// valid()
// 判断对象容器当前指针后面是否有值
$obj->valid();
// key()
// 返回对象容器当前节点的索引
$obj->key();
// rewind()
// 返回并指向第一个节点元素
$obj->rewind();
// setInfo(mixed $data)
// 给当前节点赋值。必须是调用rewind后,才可以用setInfo赋值,否则找不到对象。
$obj->setInfo('AAA');
// getInfo()
// 获得当前节点的值。也必须是调用rewind后,才可以调用getInfo。
$obj->getInfo();
// current()
// 获得当前节点对象
$obj->current();
// getHash()
// 获得参数的hash值
$obj->getHash($a2);
// next()
// 指针移到下一个节点
$obj->next();
// offsetExists
// 判断对象容器中是否存在该对象
$obj->offsetExists($a2);
示例8: SplObjectStorage
<?php
$s = new SplObjectStorage();
var_dump($s->setInfo());
示例9: setInfo
/**
* Sets the data associated with the current iterator entry
*
* @param mixed $data
*/
protected function setInfo($data)
{
$this->filled = true;
parent::setInfo($data);
}