mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
50 lines
1.3 KiB
PHP
Executable File
50 lines
1.3 KiB
PHP
Executable File
<?php
|
|
|
|
namespace App\Entities\Tarifas;
|
|
|
|
use CodeIgniter\Entity;
|
|
|
|
class TarifaEncuadernacionEntity extends \CodeIgniter\Entity\Entity
|
|
{
|
|
protected $attributes = [
|
|
"id" => null,
|
|
"nombre" => null,
|
|
"code" => null,
|
|
"mostrar_en_presupuesto" => 1,
|
|
"mostrar_en_presupuesto_cliente" => 0,
|
|
"tipo_encuadernacion" => 0,
|
|
"servicio_encuadernacion" => 0,
|
|
"por_horas" => 0,
|
|
"user_created_id" => 0,
|
|
"user_updated_id" => 0,
|
|
"is_deleted" => 0,
|
|
"deleted_at" => null,
|
|
"created_at" => null,
|
|
"updated_at" => null,
|
|
];
|
|
protected $casts = [
|
|
"mostrar_en_presupuesto" => "int",
|
|
"mostrar_en_presupuesto_cliente" => "bool",
|
|
"code" => "string",
|
|
"tipo_encuadernacion" => "int",
|
|
"servicio_encuadernacion" => "int",
|
|
"por_horas" => "int",
|
|
"user_created_id" => "int",
|
|
"user_updated_id" => "int",
|
|
"is_deleted" => "int",
|
|
];
|
|
|
|
public function getNameInitials(): string
|
|
{
|
|
$words = explode(" ",$this->attributes["nombre"]);
|
|
$words_initial = array_map(fn($w) => substr(strtoupper($w),0,1),$words);
|
|
return implode("",$words_initial);
|
|
}
|
|
public function isCosido(): bool
|
|
{
|
|
return in_array($this->attributes['id'], [3, 17]);
|
|
}
|
|
|
|
|
|
}
|