mirror of
https://git.imnavajas.es/jjimenez/safekat.git
synced 2025-07-25 22:52:08 +00:00
51 lines
1.2 KiB
PHP
Executable File
51 lines
1.2 KiB
PHP
Executable File
<?php
|
|
namespace App\Entities\Usuarios;
|
|
|
|
use CodeIgniter\Entity;
|
|
|
|
class UserEntity extends \CodeIgniter\Entity\Entity
|
|
{
|
|
protected $attributes = [
|
|
"id" => null,
|
|
"first_name" => null,
|
|
"last_name" => null,
|
|
"cliente_id" => null,
|
|
"status" => null,
|
|
"status_message" => null,
|
|
'active' => null,
|
|
"last_active" => null,
|
|
"created_at" => null,
|
|
"updated_at" => null,
|
|
"deleted_at" => null,
|
|
|
|
];
|
|
protected $casts = [
|
|
"id" => "int",
|
|
"cliente_id" => "int",
|
|
"active" => "boolean",
|
|
];
|
|
/**
|
|
* Returns a full name: "first last"
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getFullName()
|
|
{
|
|
$fullName =
|
|
(!empty($this->attributes["first_name"]) ? trim($this->attributes["first_name"]) . " " : "") .
|
|
(!empty($this->attributes["last_name"]) ? trim($this->attributes["last_name"]) : "");
|
|
$name = empty($fullName) ? $this->attributes["username"] : $fullName;
|
|
return $name;
|
|
}
|
|
|
|
/**
|
|
* Alias for getFullName()
|
|
*
|
|
* @return string
|
|
*/
|
|
public function fullName()
|
|
{
|
|
return $this->getFullName();
|
|
}
|
|
}
|