Created
July 29, 2023 21:54
-
-
Save vihugarcia/d96215b3c2fd57634a9497785802a0cb to your computer and use it in GitHub Desktop.
Chapter 11 Employee Model
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\models; | |
use SimpleMVC\core\Model as Model; | |
class Employee extends Model { | |
public $id; | |
private $firstname; | |
private $lastname; | |
private $type; | |
private $userid; | |
public function __construct(string $table) | |
{ | |
$this->table = $table; | |
parent::__construct($this->table, $this->db); | |
$this->key = 'id'; | |
} | |
public function setFirstName($firstName) | |
{ | |
$this->firstname = $firstName; | |
} | |
public function setLastName($lastName) | |
{ | |
$this->lastname = $lastName; | |
} | |
public function setType($type) | |
{ | |
$this->type = $type; | |
} | |
public function setUserId($userId) | |
{ | |
$this->userid = $userId; | |
} | |
public function getFirstName() | |
{ | |
return $this->firstname; | |
} | |
public function getLastName() | |
{ | |
return $this->lastname; | |
} | |
public function getType() | |
{ | |
return $this->type; | |
} | |
public function getUserId() | |
{ | |
return $this->userid; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment