From 6aef21235059b174b629e20d88a76afcc1923e1e Mon Sep 17 00:00:00 2001 From: KJ Date: Fri, 25 Oct 2024 10:40:57 -0400 Subject: [PATCH] Fix className not returning the classname in the right format. --- src/Libs/Model.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Libs/Model.php b/src/Libs/Model.php index d8a641f..f4119ae 100644 --- a/src/Libs/Model.php +++ b/src/Libs/Model.php @@ -250,8 +250,7 @@ class Model { foreach ($elem as $key => $value) { $index = array_search($key, $propertyNames); - if (is_numeric($index) && isset($value) && - enum_exists($properties[$index]->getType()->getName())) + if (is_numeric($index) && enum_exists($properties[$index]->getType()->getName())) $instance->$key = $properties[$index]->getType()->getName()::tryfrom($value); else $instance->$key = $value; @@ -305,13 +304,8 @@ class Model { */ public static function className(): string { - return strtolower( - preg_replace( - '/(? + * @return array * Arreglo con instancias del la clase actual resultantes del query. */ public static function get(bool $resetQuery = true): array @@ -897,7 +897,7 @@ class Model { /** * Obtener todos los elementos del la tabla de la instancia actual. * - * @return array + * @return array * Contiene un arreglo de instancias de la clase actual. */ public static function all(): array