noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 13/46: Noalyss_CSV : add setter and getter


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 13/46: Noalyss_CSV : add setter and getter
Date: Mon, 4 May 2020 13:38:45 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 353bacaf37e19ece9335a4e8354c1100b1df0c75
Author: Dany De Bontridder <address@hidden>
AuthorDate: Sat Feb 22 11:14:45 2020 +0100

    Noalyss_CSV : add setter and getter
---
 include/lib/noalyss_csv.class.php | 116 ++++++++++++++++++++++++++++++++++++--
 1 file changed, 111 insertions(+), 5 deletions(-)

diff --git a/include/lib/noalyss_csv.class.php 
b/include/lib/noalyss_csv.class.php
index 4eefce8..6694034 100644
--- a/include/lib/noalyss_csv.class.php
+++ b/include/lib/noalyss_csv.class.php
@@ -58,7 +58,7 @@ class Noalyss_Csv
      * Correct the name of the file , remove forbidden character and
      * add extension and date
      */
-    private  function correct_name()
+    protected  function correct_name()
     {
         if (trim(strlen($this->filename))==0) {
             record_log('CSV->correct_name filename is empty');
@@ -157,7 +157,7 @@ class Noalyss_Csv
     /**
      * clean the row
      */
-    private function clean()
+    protected function clean()
     {
         $this->element=array();
         $this->size=0;
@@ -166,7 +166,7 @@ class Noalyss_Csv
     * format the number for the CSV export
     * @param $p_number number
     */
-   private function nb($p_number)
+    protected function nb($p_number)
    {
        $p_number=trim($p_number);
        if ($p_number=="") {return $p_number;}
@@ -177,12 +177,118 @@ class Noalyss_Csv
        }
        return $r;
    }
-   private function encode($str)
+    protected function encode($str)
    {
        if ($this->encoding=="utf8") return $str;
        if ($this->encoding=="latin1") return utf8_decode ($str);
        throw new Exception(_("Encodage invalide"));
    }
-            
+    /**
+     * @return mixed
+     */
+    public function get_filename()
+    {
+        return $this->filename;
+        return $this;
+    }
+
+    /**
+     * @param mixed $filename
+     */
+    public function set_filename($filename)
+    {
+        $this->filename = $filename;
+        return $this;
+    }
+
+    /**
+     * @return array
+     */
+    public function get_element()
+    {
+        return $this->element;
+        return $this;
+    }
+
+    /**
+     * @param array $element
+     */
+    public function set_element($element)
+    {
+        $this->element = $element;
+        return $this;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function get_sep_field()
+    {
+        return $this->sep_field;
+        return $this;
+    }
+
+    /**
+     * @param mixed $sep_field
+     */
+    public function set_sep_field($sep_field)
+    {
+        $this->sep_field = $sep_field;
+        return $this;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function get_sep_dec()
+    {
+        return $this->sep_dec;
+        return $this;
+    }
+
+    /**
+     * @param mixed $sep_dec
+     */
+    public function set_sep_dec($sep_dec)
+    {
+        $this->sep_dec = $sep_dec;
+        return $this;
+    }
+
+    /**
+     * @return mixed
+     */
+    public function get_encoding()
+    {
+        return $this->encoding;
+        return $this;
+    }
+
+    /**
+     * @param mixed $encoding
+     */
+    public function set_encoding($encoding)
+    {
+        $this->encoding = $encoding;
+        return $this;
+    }
+
+    /**
+     * @return int
+     */
+    public function get_size()
+    {
+        return $this->size;
+        return $this;
+    }
+
+    /**
+     * @param int $size
+     */
+    public function set_size($size)
+    {
+        $this->size = $size;
+        return $this;
+    }
 
 }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]