hook_update_last_removed()

Return a number which is no longer available as hook_update_N(). If you remove some update functions from your mycustommodule.install file, you should notify Drupal of those missing functions. This way, Drupal can ensure that no update is accidentally skipped. Parameters none Return value An integer, corresponding to hook_update_N() which has been removed from mycustommodule.install. Usage sample function hook_update_last_removed() {    // We’ve removed the 6.x-1.x version of mycustommodule, including database updates.    // The next update function is mycustommodule_update_6200()    return 6105; }

Continue reading »

hook_schema()

We use hook_schema() to define the current version of the database schema. During the module installation process in Drupal, you can create DB tables using .sql query or you can use hook_schema() to create tables and fields. A Drupal schema definition is an array structure representing one or more tables and their related keys and indexes. A schema is defined by hook_schema() which must be located in your module’s .install file. By implementing hook_schema() and specifying the tables your module declares, you can create and…

Continue reading »

hook_access($op, $node, $account)

Define access restrictions. This hook allows node modules to limit access to the node types they define. Parameters $op The operation to be performed. Possible values: “create” “delete” “update” “view” $node The node on which the operation is to be performed, or, if it does not yet exist, the type of node to be created. $account A user object representing the user for whom the operation is to be performed. Return value TRUE if the operation is to be allowed; FALSE if the operation is…

Continue reading »