public static final function registerAccessor(AccessorInterface $accessor) { $prefix = $accessor->getPrefix(); if (isset(self::$__accessors[$prefix])) { throw new \Exception("Override Accessor is not allowed, to enhance stability!"); } self::$__accessors[$prefix] = $accessor; }
/** * @param AccessorInterface $accessor * @return self * @throws \Exception */ public final function addAccessor(AccessorInterface $accessor) { $prefix = $accessor->getPrefix(); if (isset($this->accessors[$prefix])) { throw new \Exception("Override Accessor is not allowed, to enhance stability!"); } $this->accessors[$prefix] = $accessor; return $this; }