Release 2.35 (#5470)
* open up API for plugins by removing internal * use constants in entity column definition * simplified entity management API * bump packages * allow installing assets and run database migrations independently * bump to apidoc-bundle 5 * do not duplicate http method in API operationId * new security entries in Open API definition * changed API UI provider for Swagger to Stoplight, improved endpoint titles, hide internal endpoints * deactivate swagger json endpoint
This commit is contained in:
@@ -56,6 +56,18 @@ final class ProjectService
|
||||
return $project;
|
||||
}
|
||||
|
||||
public function saveProject(Project $project, ?Context $context = null): Project
|
||||
{
|
||||
if ($project->isNew()) {
|
||||
return $this->saveNewProject($project, $context); // @phpstan-ignore method.deprecated
|
||||
} else {
|
||||
return $this->updateProject($project); // @phpstan-ignore method.deprecated
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 2.35 - use saveProject() instead
|
||||
*/
|
||||
public function saveNewProject(Project $project, ?Context $context = null): Project
|
||||
{
|
||||
if (null !== $project->getId()) {
|
||||
@@ -97,6 +109,9 @@ final class ProjectService
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 2.35 - use saveProject() instead
|
||||
*/
|
||||
public function updateProject(Project $project): Project
|
||||
{
|
||||
$this->validateProject($project);
|
||||
@@ -108,8 +123,12 @@ final class ProjectService
|
||||
return $project;
|
||||
}
|
||||
|
||||
public function findProjectByName(string $name): ?Project
|
||||
public function findProjectByName(string $name, ?Customer $customer): ?Project
|
||||
{
|
||||
if ($customer !== null) {
|
||||
return $this->repository->findOneBy(['name' => $name, 'customer' => $customer->getId()]);
|
||||
}
|
||||
|
||||
return $this->repository->findOneBy(['name' => $name]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user