本文整理匯總了PHP中Zend\EventManager\EventManagerInterface::detach方法的典型用法代碼示例。如果您正苦於以下問題:PHP EventManagerInterface::detach方法的具體用法?PHP EventManagerInterface::detach怎麽用?PHP EventManagerInterface::detach使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\EventManager\EventManagerInterface
的用法示例。
在下文中一共展示了EventManagerInterface::detach方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: detach
/**
* @param EventManagerInterface $events
*/
public function detach(EventManagerInterface $events)
{
foreach ($this->handlers as $key => $handler) {
$events->detach($handler);
unset($this->handlers[$key]);
}
}
示例2: detach
public function detach(EventManagerInterface $events)
{
foreach ($this->listeners as $index => $listener) {
$events->detach($listener);
unset($this->listeners[$index]);
}
}
示例3: detach
/**
* @param EventManagerInterface $events
*/
public function detach(EventManagerInterface $events)
{
foreach ($this->getListeners() as $index => $listener) {
if ($events->detach($listener)) {
$this->removeListener($index);
}
}
}
示例4: detach
/**
* {@inheritDoc}
*/
public function detach(EventManagerInterface $e)
{
foreach ($this->listeners as $index => $listener) {
if ($e->detach($listener)) {
unset($this->listeners[$index]);
}
}
}
示例5: detach
/**
* {@inheritDoc}
*/
public function detach(EventManagerInterface $events)
{
foreach ($this->listeners as $index => $callback) {
if ($events->detach($callback)) {
unset($this->listeners[$index]);
}
}
}
示例6: detach
/**
* @param Events $events
*/
public function detach(Events $events)
{
foreach ($this->listeners as $index => $listener) {
if ($events->detach($listener)) {
unset($this->listeners[$index]);
}
}
}
示例7: detach
/**
* Detach all previously attached listeners
*
* @param EventManagerInterface $events
* @return void
*/
public function detach(EventManagerInterface $events)
{
foreach ($this->listeners as $key => $listener) {
if ($events->detach($listener)) {
unset($this->listeners[$key]);
}
}
}
示例8: detach
/**
* {@inheritDoc}
*/
public function detach(EventManagerInterface $events)
{
foreach ($this->handlers as $index => $listener) {
if (false !== $events->detach($listener)) {
unset($this->handlers[$index]);
}
}
}
示例9: detach
/**
* Detach aggregate listeners from the specified event manager
* @param \Zend\EventManager\EventManagerInterface $oEvents
* @return void
*/
public function detach(\Zend\EventManager\EventManagerInterface $oEvents)
{
foreach ($this->listeners as $iIndex => $oListener) {
if ($oEvents->detach($oListener)) {
unset($this->listeners[$iIndex]);
}
}
}
示例10: detach
/**
* Detach all previously attached listeners
*
* @param EventManagerInterface $events
*
* @return void
*/
public function detach(EventManagerInterface $events)
{
foreach ($this->listeners as $i => $listener) {
if ($events->detach($listener)) {
unset($this->listeners[$i]);
}
}
return empty($this->listeners);
}
示例11: detach
/**
* @param \Zend\EventManager\EventManagerInterface $oEventManager
* @return \AssetsBundle\Service\Service
*/
public function detach(\Zend\EventManager\EventManagerInterface $oEventManager)
{
foreach ($this->listeners as $iIndex => $oCallback) {
if ($oEventManager->detach($oCallback)) {
unset($this->listeners[$iIndex]);
}
}
return $this;
}
示例12: detach
/**
* (non-PHPdoc)
*
* @see \Zend\EventManager\ListenerAggregateInterface::detach()
*/
public function detach(EventManagerInterface $events)
{
$sharedEvents = $events->getSharedManager();
foreach ($this->listeners as $index => $listener) {
if ($events->detach($listener)) {
unset($this->listeners[$index]);
}
}
}
示例13: detach
public function detach(EventManagerInterface $event)
{
if (!empty($this->listeners)) {
foreach ($this->listeners as $index->{$listener}) {
if ($event->detach($listener)) {
unset($this->listeners[$index]);
}
}
}
}
示例14: detach
/**
* Detach all previously attached listeners
*
* @param EventManagerInterface $events
* @return ConfigListener
*/
public function detach(EventManagerInterface $events)
{
foreach ($this->listeners as $key => $listener) {
$events->detach($listener);
unset($this->listeners[$key]);
}
$this->listeners = array();
return $this;
}
示例15: detach
public function detach(EventManagerInterface $events)
{
$events->detach($this->listener);
}