1: <?php
2:
3: /**
4: * An AstroPay Bank
5: */
6: class Syspay_Merchant_Entity_AstroPayBank extends Syspay_Merchant_Entity implements
7: Syspay_Merchant_Entity_ReturnedEntityInterface
8: {
9: /**
10: * The bank code
11: * @var string
12: */
13: private $code;
14:
15: /**
16: * The bank name
17: * @var string
18: */
19: private $name;
20:
21: /**
22: * The full URL to the bank logo
23: * @var string
24: */
25: private $logoUrl;
26:
27: /**
28: * {@inheritDoc}
29: */
30: public static function buildFromResponse(stdClass $response)
31: {
32: $bank = new self();
33: $bank->setCode(isset($response->code)?$response->code:null);
34: $bank->setName(isset($response->name)?$response->name:null);
35: $bank->setLogoUrl(isset($response->logo)?$response->logo:null);
36:
37: $bank->raw = $response;
38:
39: return $bank;
40: }
41:
42: /**
43: * Gets the The bank code.
44: *
45: * @return string
46: */
47: public function getCode()
48: {
49: return $this->code;
50: }
51:
52: /**
53: * Sets the The bank code.
54: *
55: * @param string $code the code
56: *
57: * @return self
58: */
59: public function setCode($code)
60: {
61: $this->code = $code;
62:
63: return $this;
64: }
65:
66: /**
67: * Gets the The bank name.
68: *
69: * @return string
70: */
71: public function getName()
72: {
73: return $this->name;
74: }
75:
76: /**
77: * Sets the The bank name.
78: *
79: * @param string $name the name
80: *
81: * @return self
82: */
83: public function setName($name)
84: {
85: $this->name = $name;
86:
87: return $this;
88: }
89:
90: /**
91: * Gets the The full URL to the bank logo.
92: *
93: * @return string
94: */
95: public function getLogoUrl()
96: {
97: return $this->logoUrl;
98: }
99:
100: /**
101: * Sets the The full URL to the bank logo.
102: *
103: * @param string $logoUrl the logo url
104: *
105: * @return self
106: */
107: public function setLogoUrl($logoUrl)
108: {
109: $this->logoUrl = $logoUrl;
110:
111: return $this;
112: }
113: }
114: