| 1: | <?php |
| 2: | namespace Hyperwallet\Model; |
| 3: | |
| 4: | /** |
| 5: | * Represents a V4 Program |
| 6: | * |
| 7: | * @property string $token The program token |
| 8: | * @property \DateTime $createdOn The program creation date |
| 9: | * @property string $name The program name |
| 10: | * @property string $parentToken The parent program token |
| 11: | * |
| 12: | * @package Hyperwallet\Model |
| 13: | */ |
| 14: | class Program extends BaseModel { |
| 15: | |
| 16: | /** |
| 17: | * @internal |
| 18: | * |
| 19: | * Read only fields |
| 20: | * |
| 21: | * @var string[] |
| 22: | */ |
| 23: | private static $READ_ONLY_FIELDS = array('token', 'createdOn', 'name', 'parentToken'); |
| 24: | |
| 25: | /** |
| 26: | * Creates a instance of Program |
| 27: | * |
| 28: | * @param string[] $properties The default properties |
| 29: | */ |
| 30: | public function __construct(array $properties = array()) { |
| 31: | parent::__construct(self::$READ_ONLY_FIELDS, $properties); |
| 32: | } |
| 33: | |
| 34: | /** |
| 35: | * Get the program token |
| 36: | * |
| 37: | * @return string |
| 38: | */ |
| 39: | public function getToken() { |
| 40: | return $this->token; |
| 41: | } |
| 42: | |
| 43: | /** |
| 44: | * Get the program creation date |
| 45: | * |
| 46: | * @return \DateTime |
| 47: | */ |
| 48: | public function getCreatedOn() { |
| 49: | return $this->createdOn ? new \DateTime($this->createdOn) : null; |
| 50: | } |
| 51: | |
| 52: | /** |
| 53: | * Get the program name |
| 54: | * |
| 55: | * @return string |
| 56: | */ |
| 57: | public function getName() { |
| 58: | return $this->name; |
| 59: | } |
| 60: | |
| 61: | /** |
| 62: | * Get the parent program token |
| 63: | * |
| 64: | * @return string |
| 65: | */ |
| 66: | public function getParentToken() { |
| 67: | return $this->parentToken; |
| 68: | } |
| 69: | |
| 70: | } |
| 71: |