Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Newbie - do extension hooks exist?


Go to End


3 Posts   1321 Views

Avatar
davidhyland

Community Member, 2 Posts

21 February 2012 at 8:55am

Hello there!

I'm a Silverstripe noob and have been tasked with creating some custom functionality with an existing site (v2.3.3). Basically I need to extract data from the database at certain points and post it to webCRM's API.

Forgive the probably obvious question but does Silverstripe come with extension hooks that I can use at certain points to do this? This would need to be done upon completion of a member registration, on updating the member profile and on successful completion of a worldpay transaction.

I am only just starting to get to grips with how SS works so any pointers would be greatly appreciated.

Avatar
Willr

Forum Moderator, 5523 Posts

22 February 2012 at 5:53pm

What hooks are you wanting? Popular ones are onBeforeWrite() and onAfterWrite() (when saving objects to the database).

http://doc.silverstripe.org/sapphire/en/topics/datamodel#onbeforewrite

You can find any hooks in core by looking for $this->extend() of which their are quite a few!

Avatar
davidhyland

Community Member, 2 Posts

23 February 2012 at 4:36am

Hey Willr,

Thanks for the reply. At the moment I'm not certain what hooks I need, but your reply certainly points me in the right direction so I can hopefully figure that out :)

Many thanks!