Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
CRAP
0.00% covered (danger)
0.00%
0 / 1
ContactListIntegrationEntity
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 3
12
0.00% covered (danger)
0.00%
0 / 1
 activate
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 deactivate
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 setConfig
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3namespace App\Modules\ContactModule\Entities;
4
5use CodeIgniter\Entity\Entity;
6
7class ContactListIntegrationEntity extends Entity
8{
9    protected $attributes = [
10        'id' => null,
11        'contact_list_id' => null,
12        'type' => null,
13        'provider' => null,
14        'is_active' => false,
15        'config' => [],
16        'created_at' => null,
17        'updated_at' => null,
18    ];
19
20    protected $casts = [
21        'is_active' => 'boolean',
22        'config' => 'json',
23        'created_at' => 'datetime',
24        'updated_at' => 'datetime',
25    ];
26
27    /**
28     * Active l’intégration
29     */
30    public function activate()
31    {
32        $this->attributes['is_active'] = true;
33        return $this;
34    }
35
36    /**
37     * Désactive l’intégration
38     */
39    public function deactivate()
40    {
41        $this->attributes['is_active'] = false;
42        return $this;
43    }
44
45    /**
46     * Injecte une configuration sécurisée
47     */
48    public function setConfig(array $config)
49    {
50        $this->attributes['config'] = $config;
51        return $this;
52    }
53}