forked from AustinWise/fleet_links
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlliance.php
More file actions
74 lines (57 loc) · 1.37 KB
/
Copy pathAlliance.php
File metadata and controls
74 lines (57 loc) · 1.37 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<?php
class Default_Model_Alliance {
protected $_id;
protected $_name;
protected $_mapper;
public function __construct() {
}
public function __set($name, $value) {
$method = 'set' . $name;
if ('mapper' == $name || !method_exists($this, $method)) {
throw Exception('Invalid property specified');
}
$this->$method($value);
}
public function __get($name) {
$method = 'get' . $name;
if ('mapper' == $name || !method_exists($this, $method)) {
throw Exception('Invalid property specified');
}
$this->$method();
}
public function setId($int) {
$this->_id = (int) $int;
return $this;
}
public function getId() {
return $this->_id;
}
public function setName($text) {
$this->_name = (string) $text;
return $this;
}
public function getName() {
return $this->_name;
}
public function setMapper($mapper) {
$this->_mapper = $mapper;
return $this;
}
public function getMapper() {
if ($this->_mapper === null) {
$this->setMapper(new Default_Model_AllianceMapper());
}
return $this->_mapper;
}
public function save() {
$this->getMapper()->save($this);
}
public function find($id) {
$this->getMapper()->find($id, $this);
return $this;
}
public function fetchAll() {
return $this->getMapper()->fetchAll();
}
}
?>