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.

Customising the CMS

Newbie - do extension hooks exist?


Reply

3 Posts   531 Views

Avatar
davidhyland

21 February 2012 at 8:55am Community Member, 2 Posts

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

22 February 2012 at 5:53pm Forum Moderator, 5511 Posts

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

23 February 2012 at 4:36am Community Member, 2 Posts

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!