Skip to content
Snippets Groups Projects
Select Git revision
  • master
  • 5.x
  • ll-php8-bs5
  • release_5_bs5
  • ll-php8
  • 4.x
  • laminas_migration
  • release_1.0.0.2
  • release_4.0.0
  • release_3.2.8
  • bootstrap4_migration
  • 1.0.0.3
  • 6.0.7
  • 6.0.6
  • 6.0.5
  • 6.0.4
  • 6.0.3
  • 6.0.2
  • 6.0.1
  • 5.1.1
  • 6.0.0
  • 5.1.0
  • 5.0.0
  • 4.0.2
  • 3.2.11
  • 4.0.1
  • 3.2.10
  • 4.0.0
  • 1.0.0.2
  • 3.2.9
  • 3.2.8
31 results

schema_mysql.sql

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    PlsqlProcess.php 1.36 KiB
    <?php
    
    namespace UnicaenTbl\Process;
    
    use UnicaenTbl\Service\BddServiceAwareTrait;
    use UnicaenTbl\TableauBord;
    
    /**
     * Description of PlsqlProcess
     *
     * @author LECLUSE Laurent <laurent.lecluse at unicaen.fr>
     */
    class PlsqlProcess implements ProcessInterface
    {
        use BddServiceAwareTrait;
    
        protected TableauBord $tableauBord;
    
        /**
         * Paramètres de filtres en entrée
         */
        protected array $params;
    
        /**
         * Commande à exécuter
         */
        protected string $command;
    
    
    
    
        public function run(TableauBord $tableauBord, array $params = []): void
        {
            $this->tableauBord = $tableauBord;
            $this->params = $params;
    
            $this->command = $tableauBord->getOption('command', null, 'Une commande PL/SQL doit être spécifiée');
    
            $conn = $this->getServiceBdd()->getEntityManager()->getConnection();
            $conn->beginTransaction();
    
            if (!empty($params)) {
    
                foreach ($params as $n => $v) {
    
                    $plsql = "BEGIN $this->command(:n, :v); END;";
                    $conn->executeStatement($plsql, compact('n', 'v'));
    
                    // Seul le premier paramètre est pris en compte. Pour les autres c'est impossible
                    break;
                }
    
            }else{
                $plsql = "BEGIN $this->command(); END;";
                $conn->executeStatement($plsql);
            }
    
            $conn->commit();
        }
    
    }