mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
86 lines
3.0 KiB
PHP
86 lines
3.0 KiB
PHP
<?php
|
|
|
|
namespace App\Entities\Produccion;
|
|
|
|
use App\Entities\Usuarios\UserEntity;
|
|
use App\Models\Usuarios\UserModel;
|
|
use CodeIgniter\Entity\Entity;
|
|
|
|
class OrdenTrabajoUserEntity extends Entity
|
|
{
|
|
protected $datamap = [];
|
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
|
|
|
protected $attributes = [
|
|
"orden_trabajo_id" => null,
|
|
"user_created_id" => null,
|
|
"user_update_id" => null,
|
|
"inaplazable_revised_change_user_id" => null,
|
|
"ferro_disponible_hecho_user_id" => null,
|
|
"ferro_disponible_ok_user_id" => null,
|
|
"ferro_entregado_user_id" => null,
|
|
"pendiente_ferro_user_id" => null,
|
|
"ferro_en_cliente_user_id" => null,
|
|
"ferro_ok_user_id" => null,
|
|
"interior_bn_user_id" => null,
|
|
"interior_color_user_id" => null,
|
|
"preparacion_interior_user_id" => null,
|
|
"cubierta_user_id" => null,
|
|
"plastificado_user_id" => null,
|
|
"encuadernacion_user_id" => null,
|
|
"corte_user_id" => null,
|
|
"embalaje_user_id" => null,
|
|
"entrada_manipulado_user_id" => null,
|
|
"pre_formato_user_id" => null,
|
|
"pre_lomo_user_id" => null,
|
|
"pre_solapa_user_id" => null,
|
|
"pre_codbarras_user_id" => null,
|
|
"pre_imposicion_user_id" => null,
|
|
"pre_imprimir_user_id" => null
|
|
];
|
|
// protected array $casts = [
|
|
// "orden_trabajo_id" => "integer",
|
|
// "user_created_id" => "?integer",
|
|
// "user_update_id" => "?integer",
|
|
// "inaplazable_revised_change_user_id" => "?integer",
|
|
// "ferro_disponible_hecho_user_id" => "?integer",
|
|
// "ferro_disponible_ok_user_id" => "?integer",
|
|
// "ferro_entregado_user_id" => "?integer",
|
|
// "pendiente_ferro_user_id" => "?integer",
|
|
// "ferro_en_cliente_user_id" => "?integer",
|
|
// "ferro_ok_user_id" => "?integer",
|
|
// "interior_bn_user_id" => "?integer",
|
|
// "interior_color_user_id" => "?integer",
|
|
// "preparacion_interior_user_id" => "?integer",
|
|
// "cubierta_user_id" => "?integer",
|
|
// "plastificado_user_id" => "?integer",
|
|
// "encuadernacion_user_id" => "?integer",
|
|
// "corte_user_id" => "?integer",
|
|
// "embalaje_user_id" => "?integer",
|
|
// "entrada_manipulado_user_id" => "?integer",
|
|
// "pre_formato_user_id" => "?integer",
|
|
// "pre_lomo_user_id" => "?integer",
|
|
// "pre_solapa_user_id" => "?integer",
|
|
// "pre_codbarras_user_id" => "?integer",
|
|
// "pre_imposicion_user_id" => "?integer",
|
|
// "pre_imprimir_user_id" => "?integer"
|
|
// ];
|
|
|
|
protected function userBy(string $key): ?UserEntity
|
|
{
|
|
$user = null;
|
|
if (isset($this->attributes[$key])) {
|
|
|
|
if ($this->attributes[$key]) {
|
|
$m = model(UserModel::class);
|
|
$user = $m->find($this->attributes[$key]);
|
|
}
|
|
}
|
|
return $user;
|
|
}
|
|
public function getPlastificadoBy() : ?UserEntity
|
|
{
|
|
return $this->userBy('plastificado_user_id');
|
|
}
|
|
}
|