public function init(Context $context) { if ($this->inited) { throw new \RuntimeException("Already initialized"); } $this->inited = true; $this->context = $context; parent::__construct($context, getNextGlobalId()); }
/** * @param string $mainRef */ public function __construct($mainRef) { parent::__construct(new Context($mainRef), getNextGlobalId()); $_SESSION["executors"][$this->getId()] = $this; }
public function __construct(Context $parentCtx, BooleanResource $condition) { parent::__construct($parentCtx, getNextGlobalId()); $this->condition = $condition; $parentCtx->addChild($this->getContext()); }