[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 23/27: Data_SQL add the member
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 23/27: Data_SQL add the member |
Date: |
Wed, 4 Sep 2019 15:24:58 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 72342dbec2b4a66ca193052f0b4e5432c4f6f92a
Author: Dany De Bontridder <address@hidden>
Date: Wed Sep 4 21:11:10 2019 +0200
Data_SQL add the member
---
include/lib/data_sql.class.php | 88 +++++++++++++++++++++++++++++++++++++++++-
1 file changed, 87 insertions(+), 1 deletion(-)
diff --git a/include/lib/data_sql.class.php b/include/lib/data_sql.class.php
index 57827c0..e3bdb16 100644
--- a/include/lib/data_sql.class.php
+++ b/include/lib/data_sql.class.php
@@ -42,11 +42,39 @@
* After you call the parent constructor
* @note the view or the table must include an unique key, otherwise the load
* doesn't work.
+ *
+ * @pnote
+ * Name is an array the key is the logical name and the value is the name of
the column
+ @code
+ $this->name=array(
+ "id"=>"o_id",
+ "program"=>"o_prog",
+ "date"=>"o_date",
+ "qcode"=>"o_qcode",
+ "fiche"=>"f_id",
+ );
+@endcode
*
+ the type is an array , key = column name , value = type
+
+ * @code
+ $this->type = array(
+ "o_id"=>"numeric",
+ "o_prog"=>"numeric",
+ "o_date"=>"date",
+ "o_qcode"=>"text",
+ "f_id"=>"numeric",
+ );
+@endcode
+ *
*/
abstract class Data_SQL
{
- private $cn; //! Database connection
+ private $cn; //! Database connection
+ var $name; //! Array of logical and real name
+ var $primary_key; //! Column name of the primary key
+ var $type; //! Type of the data
+ var $date_format; //! defaullt date format
function __construct(DatabaseCore $p_cn, $p_id=-1)
{
@@ -65,6 +93,7 @@ abstract class Data_SQL
$this->$pk=$p_id;
/* load it */
if ($p_id != -1 )$this->load();
+ if ( empty($this->date_format) )
$this->date_format="DD.MM.YYYY";
}
/**
* Insert or update : if the row already exists, update otherwise insert
@@ -264,6 +293,63 @@ abstract class Data_SQL
* @return integer 0 doesn't exist , 1 exists
*/
abstract function exist() ;
+ public function get_cn()
+ {
+ return $this->cn;
+ }
+
+ public function get_name()
+ {
+ return $this->name;
+ }
+
+ public function get_primary_key()
+ {
+ return $this->primary_key;
+ }
+
+ public function get_type()
+ {
+ return $this->type;
+ }
+
+ public function set_cn($cn)
+ {
+ $this->cn=$cn;
+ return $this;
+ }
+ /**
+ *
+ * @param string $name
+ * @return $this
+ */
+ public function set_name($name)
+ {
+ $this->name=$name;
+ return $this;
+ }
+ /**
+ *
+ * @param string $primary_key
+ * @return $this
+ */
+ public function set_primary_key($primary_key)
+ {
+ $this->primary_key=$primary_key;
+ return $this;
+ }
+ /**
+ *
+ * @param array $type
+ * @return $this
+ */
+ public function set_type($type)
+ {
+ $this->type=$type;
+ return $this;
+ }
+
+
}
?>
- [Noalyss-commit] [noalyss] 07/27: #0001584: En mode «optionnelle», afficher si CA ventilée ou non. Ajout symbole "contient", (continued)
- [Noalyss-commit] [noalyss] 07/27: #0001584: En mode «optionnelle», afficher si CA ventilée ou non. Ajout symbole "contient", Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 11/27: layout, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 27/27: Merge branch 'dev7109', Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 05/27: Security : avoid direct call to Http Variable, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 19/27: #0001735: icone warning, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 13/27: Missing files for #1369: Étendre la comptabilité analytique à tous les postes?, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 10/27: #0001711: Gros souci comptanal Montant compté en absolu, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 15/27: @0001735: icone poubelle catégorie de fiche, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 17/27: #0001735: icone poubelle catégorie de fiche, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 22/27: translate, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 23/27: Data_SQL add the member,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 16/27: #0001736: PHP7 comptability + translation, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 14/27: #0001643: ajout icon "cache" pour bouton "remonter", Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 25/27: PDF_Core : add function get, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 24/27: Noalyss_SQL Create a function build query, Dany De Bontridder, 2019/09/04
- [Noalyss-commit] [noalyss] 01/27: Cosmetic, Dany De Bontridder, 2019/09/04