I have an observer triggered by multiple notifiers. I want to process one of the notifiers only the first time it triggers the observer. I have used the following code in the observer:
Code:
$this->detach($this, ['the notifier']);
where 'the notifier' is the same value as in attach in the constructor. But it doesn't detach the observer. What's wrong?
If it makes any difference, the observer processes multiple notifiers in a switch block in the update function, each notifier in a case - break block. The detach code is in only one notifier case block, just before the break statement.
Dave
zc1.5.8a, OPC 2.5.2, Bootstrap 3.7.1, SBA, zx_point-of-sale 2.5
Bookmarks