From 48a2ba74d43b34fc2f50205297a7cb147536fd77 Mon Sep 17 00:00:00 2001 From: tofulm Date: Tue, 13 Sep 2022 10:16:53 +0200 Subject: [PATCH] maj de creerobjet, pour gerer facilement les champs_editables --- UltiSnips/php.snippets | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/UltiSnips/php.snippets b/UltiSnips/php.snippets index 5aa6c69..e6ef8de 100755 --- a/UltiSnips/php.snippets +++ b/UltiSnips/php.snippets @@ -6,21 +6,23 @@ debug($${1});${0} endsnippet snippet creerobjet "SPIP creation objet" +$t = [ + $0 +]; $tables['spip_$1s'] = [ 'type' => '${1:objet}', 'principale' => 'oui', 'table_objet_surnoms' => [], - 'field'=> [ + 'field'=> array_merge([ 'id_$1' => 'bigint(21) NOT NULL', - $0 'statut' => 'varchar(20) DEFAULT "" NOT NULL', 'maj' => 'TIMESTAMP' - ], + ], $t), 'key' => [ 'PRIMARY KEY' => 'id_$1', 'KEY statut' => 'statut', ], - 'champs_editables' => [], + 'champs_editables' => array_keys($t), 'champs_versionnes' => [], 'rechercher_champs' => [], 'join' => [],