3 * Déclarations relatives à la base de données
7 * @author Olivier Tétard
9 * @package SPIP\Souscription\Pipelines
12 if (!defined('_ECRIRE_INC_VERSION')) return;
16 * Déclaration des alias de tables et filtres automatiques de champs
18 * @pipeline declarer_tables_interfaces
19 * @param array $interfaces
20 * Déclarations d'interface pour le compilateur
22 * Déclarations d'interface pour le compilateur
24 function souscription_declarer_tables_interfaces($interfaces) {
26 $interfaces['table_des_tables']['souscription_dons'] = 'souscription_dons';
33 * Déclaration des objets éditoriaux
35 * @pipeline declarer_tables_objets_sql
36 * @param array $tables
37 * Description des tables
39 * Description complétée des tables
41 function souscription_declarer_tables_objets_sql($tables) {
43 $tables['spip_souscription_dons'] =
45 'type' => 'souscription_don',
46 'principale' => "oui",
47 'table_objet_surnoms' => array('souscriptiondon'), // table_objet('souscription_don') => 'souscription_dons'
48 'field'=> array("id_souscription_don" => "bigint(21) NOT NULL",
49 "id_transaction" => "bigint(21) NOT NULL DEFAULT 0",
50 "montant" => "int(11) NOT NULL DEFAULT 0",
51 "courriel" => "text NOT NULL DEFAULT ''",
52 "nom" => "text NOT NULL DEFAULT ''",
53 "prenom" => "text NOT NULL DEFAULT ''",
54 "code_postal" => "text NOT NULL DEFAULT ''",
55 "adresse" => "text NOT NULL DEFAULT ''",
56 "ville" => "text NOT NULL DEFAULT ''",
57 "recu_fiscal" => "int(1) NOT NULL DEFAULT 0",
58 "envoyer_info" => "int(2) NOT NULL DEFAULT 0",
59 /* "statut" => "varchar(255) DEFAULT '0' NOT NULL COLLATE NOCASE", */
60 "date_souscription " => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'",
63 'key' => array("PRIMARY KEY" => "id_souscription_don",
65 'titre' => "nom AS titre, '' AS lang",
66 'date' => "date_souscription",
67 'champs_editables' => array('montant', 'courriel', 'nom', 'prenom', 'code_postal', 'adresse', 'ville', 'recu_fiscal', 'envoyer_info'),
68 'champs_versionnes' => array('montant', 'courriel', 'nom', 'prenom', 'code_postal', 'adresse', 'ville', 'recu_fiscal', 'envoyer_info'),
69 'rechercher_champs' => array(),
70 'tables_jointures' => array('spip_transactions' => 'id_transaction'),
78 /* * Déclaration des tables secondaires (liaisons) */
80 /* * @pipeline declarer_tables_auxiliaires */
81 /* * @param array $tables */
82 /* * Description des tables */
84 /* * Description complétée des tables */
86 /* function souscription_declarer_tables_auxiliaires($tables) { */
88 /* $tables['spip_souscription_dons_liens'] = */
90 /* 'field' => array("id_souscription_don" => "bigint(21) DEFAULT '0' NOT NULL", */
91 /* "id_objet" => "bigint(21) DEFAULT '0' NOT NULL", */
92 /* "objet" => "VARCHAR(25) DEFAULT '' NOT NULL", */
93 /* "vu" => "VARCHAR(6) DEFAULT 'non' NOT NULL" */
95 /* 'key' => array("PRIMARY KEY" => "id_souscription_don,id_objet,objet", */
96 /* "KEY id_souscription_don" => "id_souscription_don" */
100 /* return $tables; */