* make majestic models as orm-objects (only on single fetch record)
10_ballov-1431 Авторизация и вывод 3-й цены на мобильной версии зеленого моря
This commit is contained in:
@ -174,6 +174,22 @@ abstract class SqlModel extends Model
|
|||||||
$cache_key->set($result);
|
$cache_key->set($result);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$calledClassName = get_called_class();
|
||||||
|
|
||||||
|
if ($result) {
|
||||||
|
$orm = new $calledClassName;
|
||||||
|
|
||||||
|
foreach (get_object_vars($result) as $key => $value) {
|
||||||
|
if ($key == 'table') {
|
||||||
|
$key = 'table_field';
|
||||||
|
}
|
||||||
|
$orm->$key = $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $orm;
|
||||||
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user