/** * @param IOpenStackRelease $release * @return bool|int */ public function registerRelease(IOpenStackRelease $release) { $res = false; $release_repository = $this->release_repository; $this->tx_manager->transaction(function () use(&$res, $release, $release_repository) { $old_one = $release_repository->getByName($release->getName()); if ($old_one) { throw new EntityAlreadyExistsException('OpenStackRelease', sprintf('name %s', $release->getName())); } $old_one = $release_repository->getByReleaseNumber($release->getReleaseNumber()); if ($old_one) { throw new EntityAlreadyExistsException('OpenStackRelease', sprintf('release_number %s', $release->getReleaseNumber())); } $res = $release_repository->add($release); }); return $res; }
public function __construct(IOpenStackRelease $release, IOpenStackApiVersion $version) { $message = sprintf('Release %s does not support Api Version %s', $release->getName(), $version->getVersion()); parent::__construct($message); }
public function __construct(IOpenStackRelease $release, IOpenStackComponent $component) { $message = sprintf('Release %s does not support Component %s', $release->getName(), $component->getCodeName()); parent::__construct($message); }
public static function convertReleaseToArray(IOpenStackRelease $release) { $res = array(); $res['id'] = $release->getIdentifier(); $res['name'] = $release->getName(); $res['release_number'] = $release->getReleaseNumber(); $res['release_date'] = $release->getReleaseDate(); $res['release_notes_url'] = $release->getReleaseNotesUrl(); return $res; }