37 lines
779 B
PHP
37 lines
779 B
PHP
<?php
|
|
|
|
namespace lib\Services;
|
|
|
|
use lib\Entities\ClientEntity as Entity;
|
|
use lib\Models\ClientModel as Model;
|
|
|
|
class ClientService extends CommonService
|
|
{
|
|
private ?Model $_model = null;
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
}
|
|
final public function getClassName(): string
|
|
{
|
|
return "Client";
|
|
}
|
|
final public function getClassPath(): string
|
|
{
|
|
return $this->getClassName();
|
|
}
|
|
protected function getModel(): Model
|
|
{
|
|
if ($this->_model === null) {
|
|
$this->_model = new Model();
|
|
// $this->_model->setDebug(true);
|
|
}
|
|
return $this->_model;
|
|
}
|
|
public function getEntitByCode(string $code): Entity|null|false
|
|
{
|
|
$this->getModel()->where("Client_Code", $code);
|
|
return $this->getModel()->getEntity();
|
|
}
|
|
}
|