Completed
Push — master ( aef7f8...916348 )
by WEBEWEB
01:35
created

DataTablesSearch::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/*
4
 * This file is part of the jquery-datatables-bundle package.
5
 *
6
 * (c) 2018 WEBEWEB
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WBW\Bundle\JQuery\DataTablesBundle\Model;
13
14
use WBW\Bundle\JQuery\DataTablesBundle\API\DataTablesSearchInterface;
15
16
/**
17
 * DataTables search.
18
 *
19
 * @author webeweb <https://github.com/webeweb/>
20
 * @package WBW\Bundle\JQuery\DataTablesBundle\API
21
 */
22
class DataTablesSearch implements DataTablesSearchInterface {
23
24
    /**
25
     * Regex.
26
     *
27
     * @var bool
28
     */
29
    private $regex;
30
31
    /**
32
     * Value.
33
     *
34
     * @var string
35
     */
36
    private $value;
37
38
    /**
39
     * Constructor.
40
     */
41
    public function __construct() {
42
        $this->setRegex(false);
43
        $this->setValue("");
44
    }
45
46
    /**
47
     * {@inheritDoc}
48
     */
49
    public function getRegex(): bool {
50
        return $this->regex;
51
    }
52
53
    /**
54
     * {@inheritDoc}
55
     */
56
    public function getValue(): string {
57
        return $this->value;
58
    }
59
60
    /**
61
     * Set the regex.
62
     *
63
     * @param bool $regex The regex.
64
     * @return DataTablesSearchInterface Returns this search.
65
     */
66
    public function setRegex(bool $regex): DataTablesSearchInterface {
67
        $this->regex = $regex;
68
        return $this;
69
    }
70
71
    /**
72
     * Set the value.
73
     *
74
     * @param string $value The value.
75
     * @return DataTablesSearchInterface Returns this search.
76
     */
77
    public function setValue(string $value): DataTablesSearchInterface {
78
        $this->value = $value;
79
        return $this;
80
    }
81
}
82