PHP code example of arnoldkouya / plan-comptable-syscohada
1. Go to this page and download the library: Download arnoldkouya/plan-comptable-syscohada library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
arnoldkouya / plan-comptable-syscohada example snippets
use Syscohada\PlanComptable;
use Syscohada\Validator;
$plan = PlanComptable::getInstance();
// Rechercher un compte par code exact
$compte = $plan->find('6011');
echo $compte; // "6011 — Dans la Région"
// Trouver ou lancer une exception
$compte = $plan->findOrFail('4111');
echo $compte->getLibelle(); // "Clients"
// Tous les comptes d'une classe
$classe6 = $plan->classe(6); // array de Compte
// Recherche plein texte (insensible à la casse et aux accents)
$resultats = $plan->search('marchandises');
// Enfants directs
$enfants = $plan->enfants('60'); // [601, 602, 603, ...]
// Tous les descendants (récursif)
$descendants = $plan->descendants('60');
// Chemin depuis la racine
$chemin = $plan->chemin('6011');
// → [60, 601, 6011]