예제 #1
0
 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;
 }
예제 #2
0
 /**
  * @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;
 }