mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-03-07 00:31:08 -05:00
- PHP 8.2 deprecates dynamically declared class properties. Adding these declarations removes deprecation warnings and makes the code PHP 8.3 compatible. - Add Elvis operator to set search string to an empty string when it's value is null to get rid of an error in the search function call. - Imported class for OSPOS config - Replaced private with protected in parent controller's property. - Removed unneeded TODO - Refactored local variables - Replaced ternary notation - Removed unneeded comments - Removed unneeded class property - Removed unneeded @property declarations - Fixed database version
31 lines
436 B
PHP
31 lines
436 B
PHP
<?php
|
|
|
|
namespace App\Controllers;
|
|
|
|
use App\Models\Employee;
|
|
|
|
/**
|
|
* @property Employee employee
|
|
*/
|
|
class Office extends Secure_Controller
|
|
{
|
|
protected Employee $employee;
|
|
|
|
function __construct()
|
|
{
|
|
parent::__construct('office', NULL, 'office');
|
|
}
|
|
|
|
public function getIndex(): void
|
|
{
|
|
echo view('home/office');
|
|
}
|
|
|
|
public function logout(): void
|
|
{
|
|
$this->employee = model(Employee::class);
|
|
|
|
$this->employee->logout();
|
|
}
|
|
}
|