PHP code example of processid / manager

1. Go to this page and download the library: Download processid/manager 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/ */

    

processid / manager example snippets



    class Client extends \ProcessID\Manager\Manager {

        // Il est possible d'utiliser des colonnes chiffrées
        $this->setEncryptedFields(['nom'=>true, 'email'=>true, 'tel'=>true, 'siret'=>true]);

        // Si malgrè le chiffrement, certains champs doivent rester triables
        // il faut utiliser le daemon pour renseigner les colonnes de tri
        $this->setEncryptedFieldsSortable(['nom'=>true, 'email'=>true]);
        
        public function __construct(\ProcessID\Manager\DbConnect $db) {
            $this->setDb($db)
            $this->setTableName('clients'); // Nom de la table
            $this->setPrimaryKey('IDclients'); // Nom du champ ID de la table
            $this->setClassName('\src\model\Clients'); // Nom de la classe gérant l'objet fourni au manager
        }

    }

$this->encrypt_column($champ);

$this->decrypt_column($champ);

$this->add(\src\model\Clients $obj, [$ignore = FALSE]);

$this->get($ID, $champs);

$this->getList($IDs, $champs);

$this->update($object, $champs);

$this->delete($ID);

$arg = ['start' => 0, 'limit' => 10, 'fields' => [], 'search' => [], 'sort' = []];

$arg['fields'][] = ['table' => 'clients', 'field' => 'IDclients']
$arg['fields'][] = ['table' => 'clients', 'field' => 'nom']

$arg['search'][] = ['table' => 'clients', 'field' => 'pays', 'operator' => '=', 'value' => 'France'];

$arg['sort'][] = ['table' => 'clients', 'field' => 'nom', 'reverse' => false];

$taClients = $clientsManager->search($arg);