Block Install notification

Block Install notification

oleh Mark Williamson -
Jumlah balasan: 2

Hi,

Is there a method that gets called during a block install or update.

I know the init() method can get called when ever a block is being used / accessed, however I would like to do something only one time during install process or update process and not have to put code in an init() method which could be called multiple times, resulting in having to do checks to see if my operation has been done yet or not.

Best,

Mark

Rata-rata penilaian: -
Sebagai balasan Mark Williamson

Re: Block Install notification

oleh Jason Hardin -

If you are working in Moodle 2 then you have access to db/install.php and db/upgrade.php  see http://docs.moodle.org/dev/Installing_and_upgrading_plugin_database_tables#install.php.

To verify tough you are talking about the install and upgrade processes and not adding a block to a course correct?