/** * Get the restriction at index * * @static * * @param mixed $index The index of the register. * * @return Falcraft\Data\Types\Restrictions The restrictions registered at index * * @throws \RangeException if the restriction index is not registered. * */ public static function getRestriction($index) { if (self::$registry === null) { self::$registry = new Map(); self::initRegistry(); } if (!self::isRestrictionRegistered($index)) { throw new TypesExceptions\RangeException('TaggedUnionFactory->getRestriction: Restriction ' . $index . ' Not Registered'); } else { return self::$registry->find($index); } }
/** * Detach conduit from everything * * NOTE: you only detach yourself from the aggregate */ public function unlink() { $listeners = $this->conduit->getValues(); Types\RestrictedSet::mapInternal('detach', array($this), $listeners); $this->publishers->detachListener($this); }