Skip to content

Instantly share code, notes, and snippets.

@vihugarcia
Created July 29, 2023 21:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vihugarcia/d96215b3c2fd57634a9497785802a0cb to your computer and use it in GitHub Desktop.
Save vihugarcia/d96215b3c2fd57634a9497785802a0cb to your computer and use it in GitHub Desktop.
Chapter 11 Employee Model
<?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