This module is not enought hookable now, but we still provide experimental hooks.
These hooks have been created for us to do some specific business stuff that does not have their place in the framework core.
There are two hooks you can use, first one is used to register custom entities. The one other is a polymorphic hook, and is here to provide some content alteration at save, update and dependency construct time.
This hook is an helper that allows you to register your own entities. This hook must return an array such as:
function mymodule_yamm() { return array( 'foo' => array( 'name' => t('Foo), 'base_table' => 'foo_table', 'module' => 'mymodule') 'bar' => array( 'name' => t('Bar'), 'module' => 'mymodule), ); }
Where keys are internal object type.
In this exemple, we register two Entity subclasses, first one will be FooEntity, second one will be BarEntity.
You have to put theses classes into the entities/ subdir of your
custom module.
PHP file containing the classes must be named entity_<type>.inc
(so yours will be entity_foo.inc and entity_bar.inc).
The name element is mandatory, it will be used in settings forms. This
must be a human readable localized name for your entity.
The base_table refers to views base table used to fetch objects.
Remember that you MUST NOT use an already defined base_table.
This parameter is optional. If you dont specify a base table, then your entity
can be still used as another entity dependency.
This hook is ran when the site administrator presses the Clean state button in the Common options section of Yamm settings pages.
function mymodule_yamm_api_clean() { // Do stuff }
The original implementation meant to clean up all DataSync jobs when running massing tests, for debuging purposes. You can implement any clean task here. For example, yamm_client modules does wipe out all running transactions and remove all timeouted jobs from DataSync when this hook is invoked.
Parameters are:
Return values are:
This hook is executed on server at pull time.
$data argument is NULL here.
This hook is called at entity construct time. It's called within the Yamm_Entity class, right after the _constructDependencies() method.
What you can do here, is adding some data (it's a hook that allow you to alter internal data registry, commonly used with _setData() and _getData() methods).
This hook should return an key => value array of data to add to registry. Note that for consistency, existing values won't be overriden.
This hook is executed on client when parsing the entity dependency
tree.
$data argument contains values you saved in post_construct, mixed
will all other modules data, please avoid conflict names.
Ok, just do whatever you want here, alter some content, plant the bomb into your Drupal. What you are going to destroy here is none of my business.
This hook is executed on client when parsing the entity dependency
tree.
$data argument contains values you saved in post_construct, mixed
will all other modules data, please avoid conflict names.
Ok, just do whatever you wish here, alter some database, plant the bomb into your system. What you are going to annihilate here is none of my business.