home | career | drupal | java | mac | mysql | perl | php | scala | uml | unix

Drupal example source code file (entity_crud_hook_test.module)

This example Drupal source code file (entity_crud_hook_test.module) is included in the DevDaily.com "Drupal Source Code Warehouse" project. The intent of this project is to help you "Learn Drupal by Example".

PHP - Drupal tags/keywords

__function__, called, entity, entity_crud_hook_test_comment_delete, entity_crud_hook_test_comment_load, entity_crud_hook_test_entity_delete, entity_crud_hook_test_file_insert, entity_crud_hook_test_taxonomy_term_delete, entity_crud_hook_test_taxonomy_vocabulary_load, entity_crud_hook_test_user_insert, for, function, php, type

The entity_crud_hook_test.module Drupal example source code

<?php
// $Id: entity_crud_hook_test.module,v 1.2 2010/12/15 03:39:42 webchick Exp $

//
// Presave hooks
//

/**
 * Implements hook_entity_presave().
 */
function entity_crud_hook_test_entity_presave($entity, $type) {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
}

/**
 * Implements hook_comment_presave().
 */
function entity_crud_hook_test_comment_presave() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_file_presave().
 */
function entity_crud_hook_test_file_presave() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_node_presave().
 */
function entity_crud_hook_test_node_presave() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_term_presave().
 */
function entity_crud_hook_test_taxonomy_term_presave() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_vocabulary_presave().
 */
function entity_crud_hook_test_taxonomy_vocabulary_presave() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_user_presave().
 */
function entity_crud_hook_test_user_presave() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

//
// Insert hooks
//

/**
 * Implements hook_entity_insert().
 */
function entity_crud_hook_test_entity_insert($entity, $type) {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
}

/**
 * Implements hook_comment_insert().
 */
function entity_crud_hook_test_comment_insert() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_file_insert().
 */
function entity_crud_hook_test_file_insert() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_node_insert().
 */
function entity_crud_hook_test_node_insert() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_term_insert().
 */
function entity_crud_hook_test_taxonomy_term_insert() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_vocabulary_insert().
 */
function entity_crud_hook_test_taxonomy_vocabulary_insert() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_user_insert().
 */
function entity_crud_hook_test_user_insert() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

//
// Load hooks
//

/**
 * Implements hook_entity_load().
 */
function entity_crud_hook_test_entity_load(array $entities, $type) {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
}

/**
 * Implements hook_comment_load().
 */
function entity_crud_hook_test_comment_load() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_file_load().
 */
function entity_crud_hook_test_file_load() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_node_load().
 */
function entity_crud_hook_test_node_load() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_term_load().
 */
function entity_crud_hook_test_taxonomy_term_load() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_vocabulary_load().
 */
function entity_crud_hook_test_taxonomy_vocabulary_load() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_user_load().
 */
function entity_crud_hook_test_user_load() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

//
// Update hooks
//

/**
 * Implements hook_entity_update().
 */
function entity_crud_hook_test_entity_update($entity, $type) {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
}

/**
 * Implements hook_comment_update().
 */
function entity_crud_hook_test_comment_update() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_file_update().
 */
function entity_crud_hook_test_file_update() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_node_update().
 */
function entity_crud_hook_test_node_update() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_term_update().
 */
function entity_crud_hook_test_taxonomy_term_update() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_vocabulary_update().
 */
function entity_crud_hook_test_taxonomy_vocabulary_update() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_user_update().
 */
function entity_crud_hook_test_user_update() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

//
// Delete hooks
//

/**
 * Implements hook_entity_delete().
 */
function entity_crud_hook_test_entity_delete($entity, $type) {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called for type ' . $type);
}

/**
 * Implements hook_comment_delete().
 */
function entity_crud_hook_test_comment_delete() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_file_delete().
 */
function entity_crud_hook_test_file_delete() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_node_delete().
 */
function entity_crud_hook_test_node_delete() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_term_delete().
 */
function entity_crud_hook_test_taxonomy_term_delete() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_taxonomy_vocabulary_delete().
 */
function entity_crud_hook_test_taxonomy_vocabulary_delete() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

/**
 * Implements hook_user_delete().
 */
function entity_crud_hook_test_user_delete() {
  $_SESSION['entity_crud_hook_test'][] = (__FUNCTION__ . ' called');
}

Other Drupal examples (source code examples)

Here is a short list of links related to this Drupal entity_crud_hook_test.module source code file:

new blog posts

"Drupal" is a registered trademark of Dries Buytaert.

my drupal tutorials and examples  

Copyright 1998-2016 Alvin Alexander, alvinalexander.com
All Rights Reserved.

Beginning in 2016, a portion of the proceeds from pages under the '/drupal-code-examples/' URI will be donated to charity.