declarer_tables_auxiliaires

This pipeline declares the "auxiliary" tables, which are mainly used to create joins between principal tables.

It accepts the same arguments as the pipeline declarer_tables_principales.

Example

The plugin "SPIP Bisous" enables an author to send a poke to another author. It declares a table spip_bisous linking 2 members with the poke’s date using code as shown below. Note that the primary key is composed of 2 separate fields.

  1. function bisous_declarer_tables_auxiliaires($auxiliary_tables){
  2.  
  3. $spip_bisous = array(
  4. 'id_donneur' => 'bigint(21) DEFAULT "0" NOT NULL',
  5. 'id_receveur' => 'bigint(21) DEFAULT "0" NOT NULL',
  6. 'date' => 'datetime DEFAULT "0000-00-00 00:00:00" NOT NULL'
  7. );
  8.  
  9. $spip_bisous_key = array(
  10. 'PRIMARY KEY' => 'id_donneur, id_receveur'
  11. );
  12.  
  13. $auxiliary_tables['spip_bisous'] = array(
  14. 'field' => &$spip_bisous,
  15. 'key' => &$spip_bisous_key
  16. );
  17.  
  18. return $auxiliary_tables;
  19. }

Download

Author Gilles Vincent Published : Updated : 30/05/10

Translations : English, Español, français