Skip to content

Commit 07da740

Browse files
committed
Rename "delete" and "undelete" Functions to "remove" and "restore" Respectively
1 parent a216873 commit 07da740

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Commands/MakeMySqlRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function handle(): int
155155
// Create "delete" and "undelete" functions if necessary
156156
$hasSoftDelete = in_array('deleted_at', $columns->pluck('COLUMN_NAME')->toArray(), true);
157157
if ($hasSoftDelete) {
158-
$baseContent = substr_replace($baseContent,$deleteAndUndeleteStub, -1, 0);
158+
$baseContent = substr_replace($baseContent, $deleteAndUndeleteStub, -1, 0);
159159
}
160160

161161
$baseContent = str_replace(['{{ EntityName }}', '{{ EntityNamespace }}', '{{ FactoryName }}', '{{ FactoryNamespace }}', '{{ EntityVariableName }}', '{{ MySqlRepositoryName }}', '{{ RepositoryNamespace }}', '{{ RepositoryInterfaceName }}', '{{ TableName }}', '{{ HasSoftDelete }}'],

stubs/PHP8.0/repository.mysql.deleteAndUndelete.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @param {{ EntityName }} ${{ EntityVariableName }}
44
* @return int
55
*/
6-
public function delete({{ EntityName }} ${{ EntityVariableName }}): int
6+
public function remove({{ EntityName }} ${{ EntityVariableName }}): int
77
{
88
return $this->newQuery()
99
->where($this->primaryKey, ${{ EntityVariableName }}->getPrimaryKey())
@@ -16,7 +16,7 @@
1616
* @param {{ EntityName }} ${{ EntityVariableName }}
1717
* @return int
1818
*/
19-
public function undelete({{ EntityName }} ${{ EntityVariableName }}): int
19+
public function restore({{ EntityName }} ${{ EntityVariableName }}): int
2020
{
2121
return $this->newQuery()
2222
->where($this->primaryKey, ${{ EntityVariableName }}->getPrimaryKey())

0 commit comments

Comments
 (0)