/**
  * @param IOpenStackComponent $component
  * @return bool|int
  */
 public function registerComponent(IOpenStackComponent $component)
 {
     $res = false;
     $component_repository = $this->component_repository;
     $this->tx_manager->transaction(function () use(&$res, $component, $component_repository) {
         $old_one = $component_repository->getByName($component->getName());
         if ($old_one) {
             throw new EntityAlreadyExistsException('OpenStackComponent', sprintf('name %s', $component->getName()));
         }
         $res = $component_repository->add($component);
     });
     return $res;
 }
 public static function convertComponentToArray(IOpenStackComponent $component)
 {
     $res = array();
     $res['id'] = $component->getIdentifier();
     $res['name'] = $component->getName();
     $res['code_name'] = $component->getCodeName();
     $res['description'] = $component->getDescription();
     return $res;
 }
 public function __construct(IOpenStackRelease $release, IOpenStackComponent $component)
 {
     $message = sprintf('Release %s does not support Component %s', $release->getName(), $component->getCodeName());
     parent::__construct($message);
 }