-
Notifications
You must be signed in to change notification settings - Fork 0
/
SqlSetting.php
50 lines (43 loc) · 1.1 KB
/
SqlSetting.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
/**
* Created by IntelliJ IDEA.
* User: Mattias Kågström
* Date: 2017-04-04
* Time: 11:21
*/
class SqlSetting
{
private $dblocation, $query, $id, $friendlyName;
function __construct($id, $dblocation, $query, $friendlyName)
{
$this->id = $id;
$this->dblocation = $dblocation;
$this->query = $query;
$this->friendlyName = $friendlyName;
}
public function getObject(){
$object["id"] = $this->id;
$object["dblocation"] = $this->dblocation;
$object["query"] = $this->query;
$object["name"] = $this->friendlyName;
return $object;
}
/**
* @return mixed
*/
public function getDblocation()
{
return $this->dblocation;
}
/**
* @return mixed
*/
public function getQuery()
{
return $this->query;
}
public function replaceVariable($varName, $newValue, $variable){
$this->query = str_replace("{%" . $varName . "%}",$newValue,$this->query);
$this->dblocation = str_replace("{%" . $varName . "%}",$newValue,$this->dblocation);
}
}