Example #1
0
 /**
  * @param $name
  * @param array $params
  * @throws \Jironett\Registers\DuplicateKeyException
  */
 public function addRegistry($name, $params = [])
 {
     if (array_key_exists($name, $this->registers)) {
         throw new DuplicateKeyException("The registry with name " . $name . " already exists");
     }
     $registry = new Registry();
     $dataType = isset($params['dataType']) ? $params['dataType'] : null;
     $class = isset($params['class']) ? $params['class'] : null;
     $registry->setDataType($dataType, $class);
     $this->registers[$name] = $registry;
 }