コード例 #1
0
ファイル: Activity.php プロジェクト: CampaignChain/core
 /**
  * If the Activity equals the Operation, then set the status of the Activity to the same value.
  *
  * @param string $status
  * @param bool   $calledFromOperation
  *
  * @return Activity
  */
 public function setStatus($status, $calledFromOperation = false)
 {
     parent::setStatus($status);
     // Change the Operation as well only if this method has not been called by an Operation instance to avoid recursion.
     if (!$calledFromOperation && $this->getEqualsOperation() && count($this->getOperations())) {
         $this->getOperations()[0]->setStatus($this->status, true);
     }
     return $this;
 }
コード例 #2
0
ファイル: Operation.php プロジェクト: CampaignChain/core
 /**
  * If the Activity equals the Operation, then set the status of the Activity to the same value.
  *
  * @param string $status
  * @param bool   $calledFromActivity
  *
  * @return Operation
  */
 public function setStatus($status, $calledFromActivity = false)
 {
     parent::setStatus($status);
     // Change the Activity as well only if this method has not been called by an Activity instance to avoid recursion.
     if (!$calledFromActivity && $this->getActivity() && $this->getActivity()->getEqualsOperation()) {
         $this->getActivity()->setStatus($this->status, true);
     }
     return $this;
 }
コード例 #3
0
 public function processAction(Action $action)
 {
     $action->setStatus(Action::STATUS_PAUSED);
     return $action;
 }