@@ 56-73 (lines=18) @@ | ||
53 | * |
|
54 | * @return |
|
55 | */ |
|
56 | public function delete($modelitem_id) |
|
57 | { |
|
58 | $this->find($modelitem_id); |
|
59 | ||
60 | $this->brokenBeforeDelete = true; |
|
61 | $this->beforeDelete(); |
|
62 | if ($this->brokenBeforeDelete) { |
|
63 | throw new WriteableException('ModelAdmin has a broken beforeDelete method. Make sure you call parent::beforeDelete() on all instances of beforeDelete()', 1); |
|
64 | } |
|
65 | ||
66 | $this->doDelete(); |
|
67 | ||
68 | $this->brokenAfterDelete = true; |
|
69 | $this->afterDelete(); |
|
70 | if ($this->brokenAfterDelete) { |
|
71 | throw new WriteableException('ModelAdmin has a broken afterDelete method. Make sure you call parent::afterDelete() on all instances of afterDelete()', 1); |
|
72 | } |
|
73 | } |
|
74 | ||
75 | /** |
|
76 | * The actual delete action. |
@@ 82-99 (lines=18) @@ | ||
79 | * |
|
80 | * @return |
|
81 | */ |
|
82 | public function delete($modelitem_id) |
|
83 | { |
|
84 | $this->findWithTrashed($modelitem_id); |
|
85 | ||
86 | $this->brokenBeforeDelete = true; |
|
87 | $this->beforeDelete(); |
|
88 | if ($this->brokenBeforeDelete) { |
|
89 | throw new WriteableException('ModelAdmin has a broken beforeDelete method. Make sure you call parent::beforeDelete() on all instances of beforeDelete()', 1); |
|
90 | } |
|
91 | ||
92 | $this->doDelete(); |
|
93 | ||
94 | $this->brokenAfterDelete = true; |
|
95 | $this->afterDelete(); |
|
96 | if ($this->brokenAfterDelete) { |
|
97 | throw new WriteableException('ModelAdmin has a broken afterDelete method. Make sure you call parent::afterDelete() on all instances of afterDelete()', 1); |
|
98 | } |
|
99 | } |
|
100 | ||
101 | /** |
|
102 | * The actual delete action. |