This commit is contained in:
2022-06-13 21:36:52 -04:00
parent 3580738273
commit 42a97bb074
100 changed files with 2574 additions and 313 deletions

View File

@ -0,0 +1,26 @@
<?php
namespace Incoviba\Mapper;
use Incoviba\Model\Model;
use Incoviba\Model\Proyecto\ProyectoAgente as AgenteModel;
class ProyectoAgente extends Mapper
{
protected string $table = 'proyecto_agente';
protected function load(bool|array $row, bool $lazy = false): AgenteModel|bool
{
$model = new AgenteModel();
$model->id = $row['id'];
$model->proyecto = $this->getMapper(Proyecto::class)->fetchById($row['proyecto']);
$model->agenteTipo = $this->getMapper(AgenteTipo::class)->fetchById($row['agente']);
$model->fecha = new \DateTimeImmutable($row['fecha']);
$model->comision = $row['comision'];
return $model;
}
public function save(Model $model): bool
{
// TODO: Implement save() method.
}
}