PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.5.9
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.5.9
1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / src / Models / ContactList.php
hostinger-reach / src / Models Last commit date
Cart.php 7 months ago ContactList.php 11 months ago Form.php 9 months ago Model.php 11 months ago PluginData.php 8 months ago
ContactList.php
48 lines
1 <?php
2
3 namespace Hostinger\Reach\Models;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 die;
7 }
8
9 class ContactList implements Model {
10 private int $id = 0;
11 private string $name;
12
13
14 public function __construct( array $db_array = array() ) {
15 if ( isset( $db_array['id'] ) ) {
16 $this->set_id( $db_array['id'] );
17 }
18
19 if ( isset( $db_array['name'] ) ) {
20 $this->set_name( $db_array['name'] );
21 }
22 }
23
24 public function get_id(): int {
25 return $this->id;
26 }
27
28 public function set_id( int $id ): void {
29 $this->id = $id;
30 }
31
32 public function get_name(): string {
33 return $this->name;
34 }
35
36 public function set_name( string $name ): void {
37 $this->name = sanitize_text_field( trim( $name ) );
38 }
39
40
41 public function to_array(): array {
42 return array(
43 'id' => $this->get_id(),
44 'name' => $this->get_name(),
45 );
46 }
47 }
48