Skip to content
Snippets Groups Projects
Verified Commit 8228b59f authored by Jiří Pudil's avatar Jiří Pudil
Browse files

bring back save() method in place of insertOrUpdate()

parent e9037510
No related branches found
No related tags found
1 merge request!50more robust creation/modification API
Pipeline #53329 passed with warnings
......@@ -255,7 +255,6 @@ final class TableImplementation implements Capability
$namespace->addUse(GivenSearchCriteriaHaveNotMatchedAnyRows::class);
$classType->addMethod('save')
->addComment('@deprecated')
->addComment('@throws RowWithGivenPrimaryKeyAlreadyExists')
->addComment('@throws GivenSearchCriteriaHaveNotMatchedAnyRows')
->setReturnType('void')
......@@ -286,17 +285,6 @@ final class TableImplementation implements Capability
'$this->tableManager->update($this, $changes);',
);
$classType->addMethod('insertOrUpdate')
->addComment('@throws RowWithGivenPrimaryKeyAlreadyExists')
->addComment('@throws GivenSearchCriteriaHaveNotMatchedAnyRows')
->setReturnType('void')
->setParameters([
(new Code\Parameter('changes'))->setType($this->modificationClass),
])
->setBody(
'$this->tableManager->save($this, $changes);',
);
$classType->addMethod('delete')
->setReturnType('void')
->setParameters([
......
......@@ -179,7 +179,6 @@ final class PackagesTable implements Table
/**
* @deprecated
* @throws RowWithGivenPrimaryKeyAlreadyExists
* @throws GivenSearchCriteriaHaveNotMatchedAnyRows
*/
......@@ -207,16 +206,6 @@ final class PackagesTable implements Table
}
/**
* @throws RowWithGivenPrimaryKeyAlreadyExists
* @throws GivenSearchCriteriaHaveNotMatchedAnyRows
*/
public function insertOrUpdate(PackageModifications $changes): void
{
$this->tableManager->save($this, $changes);
}
public function delete(PackageRow|PackagePrimaryKey $rowOrKey): void
{
$primaryKey = $rowOrKey instanceof PackagePrimaryKey ? $rowOrKey : PackagePrimaryKey::fromRow($rowOrKey);
......
......@@ -177,7 +177,6 @@ final class TestsTable implements Table
/**
* @deprecated
* @throws RowWithGivenPrimaryKeyAlreadyExists
* @throws GivenSearchCriteriaHaveNotMatchedAnyRows
*/
......@@ -205,16 +204,6 @@ final class TestsTable implements Table
}
/**
* @throws RowWithGivenPrimaryKeyAlreadyExists
* @throws GivenSearchCriteriaHaveNotMatchedAnyRows
*/
public function insertOrUpdate(TestModifications $changes): void
{
$this->tableManager->save($this, $changes);
}
public function delete(TestRow|TestPrimaryKey $rowOrKey): void
{
$primaryKey = $rowOrKey instanceof TestPrimaryKey ? $rowOrKey : TestPrimaryKey::fromRow($rowOrKey);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment