forked from Wavyzz/dolibarr
Update typing for database functions
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2014-2015 Raphaël Doursenaud <rdoursenaud@gpcsolutions.fr>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -326,7 +327,7 @@ interface Database
|
||||
* Create a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param array $fields Associative table [field name][table of descriptions]
|
||||
* @param array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> $fields Associative table [field name][table of descriptions]
|
||||
* @param string $primary_key Name of the field that will be the primary key
|
||||
* @param string $type Type of the table
|
||||
* @param array $unique_keys Associative array Name of fields that will be unique key => value
|
||||
@@ -360,7 +361,7 @@ interface Database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to add
|
||||
* @param string $field_desc Associative array of description of the field to insert [parameter name][parameter value]
|
||||
* @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Associative array of description of the field to insert [parameter name][parameter value]
|
||||
* @param string $field_position Optional ex .: "after field stuff"
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
@@ -384,7 +385,7 @@ interface Database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to modify
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Array with description of field format
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function DDLUpdateField($table, $field_name, $field_desc);
|
||||
|
||||
@@ -266,7 +266,7 @@ abstract class DoliDB implements Database
|
||||
/**
|
||||
* Return version of database server into an array
|
||||
*
|
||||
* @return array Version array
|
||||
* @return string[] Version array
|
||||
*/
|
||||
public function getVersionArray()
|
||||
{
|
||||
|
||||
@@ -814,7 +814,7 @@ class DoliDBMysqli extends DoliDB
|
||||
* Create a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||
* @param string $type Type de la table
|
||||
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||
@@ -941,7 +941,7 @@ class DoliDBMysqli extends DoliDB
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to add
|
||||
* @param string $field_desc Associative table with description of field to insert [parameter name][parameter value]
|
||||
* @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Associative table with description of field to insert [parameter name][parameter value]
|
||||
* @param string $field_position Optional e.g.: "after some_field"
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
@@ -988,7 +988,7 @@ class DoliDBMysqli extends DoliDB
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to modify
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Array with description of field format
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function DDLUpdateField($table, $field_name, $field_desc)
|
||||
|
||||
@@ -1057,7 +1057,7 @@ class DoliDBPgsql extends DoliDB
|
||||
* Create a table into database
|
||||
*
|
||||
* @param string $table Nom de la table
|
||||
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||
* @param string $type Type de la table
|
||||
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||
@@ -1257,7 +1257,7 @@ class DoliDBPgsql extends DoliDB
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to modify
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Array with description of field format
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function DDLUpdateField($table, $field_name, $field_desc)
|
||||
|
||||
@@ -959,7 +959,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
* Create a table into database
|
||||
*
|
||||
* @param string $table Nom de la table
|
||||
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param array<string,array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||
* @param string $type Type de la table
|
||||
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||
@@ -1082,7 +1082,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
*
|
||||
* @param string $table Table name
|
||||
* @param string $field_name Field name to add
|
||||
* @param string $field_desc Associative table with description of field to insert [parameter name][parameter value]
|
||||
* @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Associative table with description of field to insert [parameter name][parameter value]
|
||||
* @param string $field_position Optional e.g.: "after some_field"
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
@@ -1129,7 +1129,7 @@ class DoliDBSqlite3 extends DoliDB
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to modify
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @param array{type:string,label:string,enabled:int<0,2>|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Array with description of field format
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function DDLUpdateField($table, $field_name, $field_desc)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2023 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@@ -494,7 +495,7 @@ class TraceableDB extends DoliDB
|
||||
* Create a table into database
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param array $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param array<string,array{type:string,label:string,enabled:int|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string}> $fields Tableau associatif [nom champ][tableau des descriptions]
|
||||
* @param string $primary_key Nom du champ qui sera la clef primaire
|
||||
* @param string $type Type de la table
|
||||
* @param array $unique_keys Tableau associatifs Nom de champs qui seront clef unique => valeur
|
||||
@@ -533,7 +534,7 @@ class TraceableDB extends DoliDB
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to add
|
||||
* @param string $field_desc Tableau associatif de description du champ a inserer[nom du parameter][valeur du parameter]
|
||||
* @param array{type:string,label:string,enabled:int|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Tableau associatif de description du champ a inserer[nom du parameter][valeur du parameter]
|
||||
* @param string $field_position Optionnel ex.: "after champtruc"
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
@@ -559,7 +560,7 @@ class TraceableDB extends DoliDB
|
||||
*
|
||||
* @param string $table Name of table
|
||||
* @param string $field_name Name of field to modify
|
||||
* @param string $field_desc Array with description of field format
|
||||
* @param array{type:string,label:string,enabled:int|string,position:int,notnull?:int,visible:int,noteditable?:int,default?:string,index?:int,foreignkey?:string,searchall?:int,isameasure?:int,css?:string,csslist?:string,help?:string,showoncombobox?:int,disabled?:int,arrayofkeyval?:array<int,string>,comment?:string} $field_desc Array with description of field format
|
||||
* @return int Return integer <0 if KO, >0 if OK
|
||||
*/
|
||||
public function DDLUpdateField($table, $field_name, $field_desc)
|
||||
|
||||
Reference in New Issue
Block a user