Created
September 9, 2015 16:12
-
-
Save lozcalver/d4c3aa80f7015a89d183 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Injector: | |
ManyManyList: | |
class: ManyManyListWithHook |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ManyManyListWithHook extends ManyManyList { | |
/** | |
* @param mixed $item | |
* @param array|null $extraFields | |
*/ | |
public function add($item, $extraFields = null) { | |
parent::add($item, $extraFields); | |
if($item instanceof DataObject) { | |
$item->extend('onAfterManyManyAdd'); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment