1 | <?php |
---|
2 | /** |
---|
3 | * Déclarations relatives à la base de données |
---|
4 | * |
---|
5 | * @plugin Commits de projet |
---|
6 | * @copyright 2014-2017 |
---|
7 | * @author Teddy Payet |
---|
8 | * @licence GNU/GPL |
---|
9 | * @package SPIP\RSSCommits\Pipelines |
---|
10 | */ |
---|
11 | |
---|
12 | if (!defined('_ECRIRE_INC_VERSION')) { |
---|
13 | return; |
---|
14 | } |
---|
15 | |
---|
16 | |
---|
17 | /** |
---|
18 | * Déclaration des alias de tables et filtres automatiques de champs |
---|
19 | * |
---|
20 | * @pipeline declarer_tables_interfaces |
---|
21 | * |
---|
22 | * @param array $interfaces |
---|
23 | * Déclarations d'interface pour le compilateur |
---|
24 | * |
---|
25 | * @return array |
---|
26 | * Déclarations d'interface pour le compilateur |
---|
27 | */ |
---|
28 | function rss_commits_declarer_tables_interfaces($interfaces) { |
---|
29 | |
---|
30 | $interfaces['table_des_tables']['commits'] = 'commits'; |
---|
31 | |
---|
32 | return $interfaces; |
---|
33 | } |
---|
34 | |
---|
35 | |
---|
36 | /** |
---|
37 | * Déclaration des objets éditoriaux |
---|
38 | * |
---|
39 | * @pipeline declarer_tables_objets_sql |
---|
40 | * |
---|
41 | * @param array $tables |
---|
42 | * Description des tables |
---|
43 | * |
---|
44 | * @return array |
---|
45 | * Description complétée des tables |
---|
46 | */ |
---|
47 | function rss_commits_declarer_tables_objets_sql($tables) { |
---|
48 | |
---|
49 | $tables['spip_commits'] = array( |
---|
50 | 'type' => 'commit', |
---|
51 | 'principale' => "oui", |
---|
52 | 'field' => array( |
---|
53 | "id_commit" => "bigint(21) NOT NULL", |
---|
54 | "titre" => "text NOT NULL DEFAULT ''", |
---|
55 | "descriptif" => "text NOT NULL DEFAULT ''", |
---|
56 | "texte" => "text NOT NULL DEFAULT ''", |
---|
57 | "auteur" => "varchar(255) NOT NULL DEFAULT ''", |
---|
58 | "url_revision" => "text NOT NULL DEFAULT ''", |
---|
59 | "guid" => "text NOT NULL DEFAULT ''", |
---|
60 | "id_projet" => "bigint(21) NOT NULL DEFAULT 0", |
---|
61 | "date_creation" => "datetime NOT NULL DEFAULT '0000-00-00 00:00:00'", |
---|
62 | "maj" => "TIMESTAMP", |
---|
63 | ), |
---|
64 | 'key' => array( |
---|
65 | "PRIMARY KEY" => "id_commit", |
---|
66 | "KEY id_projet" => "id_projet", |
---|
67 | ), |
---|
68 | 'titre' => "titre AS titre, '' AS lang", |
---|
69 | 'date' => "date_creation", |
---|
70 | 'champs_editables' => array( |
---|
71 | 'titre', |
---|
72 | 'descriptif', |
---|
73 | 'texte', |
---|
74 | 'auteur', |
---|
75 | 'url_revision', |
---|
76 | 'guid', |
---|
77 | 'id_projet', |
---|
78 | ), |
---|
79 | 'champs_versionnes' => array( |
---|
80 | 'titre', |
---|
81 | 'descriptif', |
---|
82 | 'texte', |
---|
83 | 'auteur', |
---|
84 | 'url_revision', |
---|
85 | 'guid', |
---|
86 | 'id_projet', |
---|
87 | ), |
---|
88 | 'rechercher_champs' => array( |
---|
89 | "titre" => 6, |
---|
90 | "descriptif" => 7, |
---|
91 | "texte" => 7, |
---|
92 | "auteur" => 8, |
---|
93 | "url_revision" => 5, |
---|
94 | ), |
---|
95 | 'tables_jointures' => array(), |
---|
96 | |
---|
97 | |
---|
98 | ); |
---|
99 | |
---|
100 | return $tables; |
---|
101 | } |
---|
102 | |
---|