File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -14,4 +14,6 @@ public function __construct(Mapper $mapper)
1414 public function getRepositoryClass (Space $ space ) {}
1515 public function getEntityClass (Space $ space ) {}
1616 public function beforeCreate (Entity $ instance , Space $ space ) {}
17- }
17+ public function beforeUpdate (Entity $ instance , Space $ space ) {}
18+ public function beforeRemove (Entity $ instance , Space $ space ) {}
19+ }
Original file line number Diff line number Diff line change @@ -195,6 +195,7 @@ public function remove($instance)
195195 foreach ($ this ->space ->getPrimaryIndex ()->parts as $ part ) {
196196 $ pk [] = $ this ->original [$ key ][$ part [0 ]];
197197 }
198+ $ plugin ->beforeRemove ($ instance , $ this ->space );
198199
199200 $ this ->space ->getMapper ()->getClient ()
200201 ->getSpace ($ this ->space ->getId ())
@@ -248,6 +249,7 @@ public function save($instance)
248249 foreach ($ this ->space ->getPrimaryIndex ()->parts as $ part ) {
249250 $ pk [] = $ this ->original [$ key ][$ part [0 ]];
250251 }
252+ $ plugin ->beforeCreate ($ instance , $ this ->space );
251253
252254 $ client ->getSpace ($ this ->space ->getId ())->update ($ pk , $ operations );
253255 $ this ->original [$ key ] = $ tuple ;
@@ -266,4 +268,4 @@ public function flushCache()
266268 {
267269 $ this ->cache = [];
268270 }
269- }
271+ }
You can’t perform that action at this time.
0 commit comments