Skip to content

Commit

Permalink
[Continuation] Replaced the ContinuationServer::$flowDefinitions fiel…
Browse files Browse the repository at this point in the history
…d with $exclusivePageFlows. (Issue piece#4)
  • Loading branch information
iteman committed Sep 18, 2012
1 parent ee2ff8f commit 6bfb7df
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Piece/Flow/Continuation/ContinuationServer.php
Expand Up @@ -52,7 +52,7 @@
*/
class ContinuationServer
{
protected $flowDefinitions = array();
protected $exclusivePageFlows = array();
protected $flowExecutionTicketCallback;
protected $flowIDCallback;
protected $eventNameCallback;
Expand Down Expand Up @@ -96,8 +96,10 @@ public function __construct(PageFlowRepository $pageFlowRepository, GC $gc = nul
*/
public function addFlow($flowID, $isExclusive = false)
{
$this->flowDefinitions[$flowID] = array('isExclusive' => $isExclusive);
$this->pageFlowRepository->add($flowID);
if ($isExclusive) {
$this->exclusivePageFlows[] = $flowID;
}
}

/**
Expand Down Expand Up @@ -376,7 +378,7 @@ protected function getFlowID()
*/
protected function isExclusive()
{
return $this->flowDefinitions[$this->activeFlowID]['isExclusive'];
return in_array($this->activeFlowID, $this->exclusivePageFlows);
}
}

Expand Down

0 comments on commit 6bfb7df

Please sign in to comment.