| 1 |
<?php if (! defined('ABSPATH')) exit; // Exit if accessed directly |
| 2 |
class SH4_Employees_Model |
| 3 |
{ |
| 4 |
const STATUS_ACTIVE = 'publish'; |
| 5 |
const STATUS_ARCHIVE = 'trash'; |
| 6 |
|
| 7 |
private $id = null; |
| 8 |
private $title = ''; |
| 9 |
private $description = ''; |
| 10 |
private $status = self::STATUS_ACTIVE; |
| 11 |
private $sortOrder = 1; |
| 12 |
|
| 13 |
public function __construct( $id, $title, $description = '', $status = self::STATUS_ACTIVE, $sortOrder = 1 ) |
| 14 |
{ |
| 15 |
$this->id = $id; |
| 16 |
$this->title = $title; |
| 17 |
$this->description = $description; |
| 18 |
$this->status = $status; |
| 19 |
$this->sortOrder = $sortOrder; |
| 20 |
} |
| 21 |
|
| 22 |
public function getId() |
| 23 |
{ |
| 24 |
return $this->id; |
| 25 |
} |
| 26 |
|
| 27 |
public function getTitle() |
| 28 |
{ |
| 29 |
return $this->title; |
| 30 |
} |
| 31 |
|
| 32 |
public function getDescription() |
| 33 |
{ |
| 34 |
$ret = ( null === $this->description ) ? '' : $this->description; |
| 35 |
return $ret; |
| 36 |
} |
| 37 |
|
| 38 |
public function isActive() |
| 39 |
{ |
| 40 |
return ($this->status == self::STATUS_ACTIVE); |
| 41 |
} |
| 42 |
|
| 43 |
public function isArchived() |
| 44 |
{ |
| 45 |
return ($this->status == self::STATUS_ARCHIVE); |
| 46 |
} |
| 47 |
|
| 48 |
public function getSortOrder() |
| 49 |
{ |
| 50 |
return $this->sortOrder; |
| 51 |
} |
| 52 |
} |