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: 75: 76: 77: 78: 79: 80: 81: 82: 83: 84: 85: 86: 87: 88: 89: 90: 91: 92: 93: 94: 95: 96: 97:
<?php
namespace Angelfon\SDK\Rest\Api\V099;
use Angelfon\SDK\Values;
use Angelfon\SDK\Version;
use Angelfon\SDK\Exceptions\AngelfonException;
use Angelfon\SDK\InstanceResource;
class UserInstance extends InstanceResource
{
protected $_calls;
function __construct(Version $version, array $payload)
{
parent::__construct($version);
$this->properties = array(
'id' => Values::array_get($payload, 'id'),
'email' => Values::array_get($payload, 'email'),
'name' => Values::array_get($payload, 'name'),
'maxRecipients' => Values::array_get($payload, 'maxrcp'),
'callerId' => Values::array_get($payload, 'callerid'),
'timezone' => Values::array_get($payload, 'timezone'),
);
}
protected function proxy()
{
if (!$this->context) {
$this->context = new AccountContext($this->version);
}
return $this->context;
}
public function fetch() {
return $this->proxy()->fetch();
}
public function update($options = array()) {
return $this->proxy()->update($options);
}
public function __get($name) {
if (array_key_exists($name, $this->properties)) {
return $this->properties[$name];
}
if (property_exists($this, '_' . $name)) {
$method = 'get' . ucfirst($name);
return $this->$method();
}
throw new AngelfonException('Unknown property: ' . $name);
}
public function __toString() {
$context = array();
foreach ($this->solution as $key => $value) {
$context[] = "$key=$value";
}
return '[Angelfon.SDK.Api.V099.UserInstance ' . implode(' ', $context) . ']';
}
}