From 884493c1fb985adaaa537c11f4350d940cc68cb1 Mon Sep 17 00:00:00 2001 From: polo Date: Tue, 4 Jul 2023 15:52:55 +0200 Subject: =?UTF-8?q?fonctions=20fichiers=20s=C3=A9par=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Latex.php | 35 +++++++++++++++++++++++++++++++---- 1 file changed, 31 insertions(+), 4 deletions(-) (limited to 'src/Latex.php') diff --git a/src/Latex.php b/src/Latex.php index 9ae9435..a766fd6 100644 --- a/src/Latex.php +++ b/src/Latex.php @@ -9,6 +9,30 @@ abstract class Latex protected $latexPath = ''; protected $pdfPath = ''; + static function makeLatexSubClass(string $type): Object + { + switch($type) + { + // documents pour les clients + case 'devis': + return new DevisLatex(); + case 'facture': + return new FactireLatex(); + case 'location': + return new LocationLatex(); + case 'enveloppe_recto': + return new EnveloppeRectoLatex(); + case 'enveloppe_verso': + return new EnveloppeVersoLatex(); + + // documents pour la compta + + // erreur + default: + echo 'erreur, la sous-classe latex à initialiser n\'existe pas'; + } + } + protected function createFile(string $latex, string $fileName, string $latexPath) { // nom du fichier créé = nom.tex @@ -24,6 +48,7 @@ abstract class Latex } + abstract class PrestaLatex extends Latex { public function __construct(string $quoi, string $codePresta) @@ -38,21 +63,23 @@ abstract class PrestaLatex extends Latex } } +//~ class PrestaClassFactory extends PrestaLatex +//~ {} + class DevisLatex extends PrestaLatex {} - class FactureLatex extends PrestaLatex {} - class LocationLatex extends PrestaLatex {} -class EnveloppeRectoLatex extends PrestaLatex +class EnveloppeRectoLatex// extends PrestaLatex {} -class EnveloppeVersoLatex extends PrestaLatex +class EnveloppeVersoLatex// extends PrestaLatex {} + abstract class ComptaLatex extends Latex { public function __construct(string $quoi, string $annee, int $numeroMois = 0) -- cgit v1.2.3