mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
33 lines
797 B
PHP
33 lines
797 B
PHP
<?php
|
|
|
|
namespace App\Entities\Produccion;
|
|
|
|
use App\Models\OrdenTrabajo\OrdenTrabajoModel;
|
|
use CodeIgniter\Entity\Entity;
|
|
|
|
class OrdenTrabajoFileEntity extends Entity
|
|
{
|
|
protected $attributes = [
|
|
"orden_trabajo_id" => null,
|
|
"name" => null,
|
|
"upload_by" => null,
|
|
"file_path" => null
|
|
];
|
|
protected $casts = [
|
|
"orden_trabajo_id" => "integer",
|
|
"name" => "string",
|
|
"upload_by" => "integer",
|
|
"file_path" => "string"
|
|
];
|
|
|
|
public function orden_trabajo(): ?OrdenTrabajoEntity
|
|
{
|
|
$m = model(OrdenTrabajoModel::class);
|
|
return $m->find($this->attributes["orden_trabajo_id"]);
|
|
}
|
|
public function hash(): string
|
|
{
|
|
return array_reverse(explode('/', $this->attributes["file_path"]))[0];
|
|
}
|
|
}
|