* @author Dennis Eichhorn * @copyright 2013 Dennis Eichhorn * @license OMS License 1.0 * @version 1.0.0 * @link http://orange-management.com */ namespace Modules\Organization\Models; use phpOMS\Contract\ArrayableInterface; class Position implements ArrayableInterface, \JsonSerializable { private $id = 0; private $name = ''; private $parent = null; private $description = ''; public function getId() : int { return $this->id; } public function getName() : string { return $this->name; } public function setName(string $name) { $this->name = $name; } public function getParent() { return $this->parent; } public function setParent(int $parent) { $this->parent = $parent; } public function getDescription() : string { return $this->description; } public function setDescription(string $desc) { $this->description = $desc; } public function toArray() : array { return [ 'id' => $this->id, 'name' => $this->name, 'description' => $this->description, ]; } /** * Get string representation. * * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ public function __toString() { return $this->jsonSerialize(); } /** * Json serialize. * * @return string * * @since 1.0.0 * @author Dennis Eichhorn */ public function jsonSerialize() { return json_encode($this->toArray()); } }