[AVATAR] Fixed avatar upload, added avatar inline download and updated template and base controller

This commit is contained in:
Hugo Sales
2020-08-08 16:10:25 +00:00
committed by Hugo Sales
parent 2bf914f96f
commit bd8f4bd277
13 changed files with 303 additions and 97 deletions

View File

@@ -23,6 +23,7 @@ namespace App\Core;
use App\Core\DB\DB;
use App\Util\Formatting;
use DateTime;
class Entity
{
@@ -33,7 +34,8 @@ class Entity
$args['created'] = $args['modified'] = new DateTime();
foreach ($args as $prop => $val) {
if (property_exists($class, $prop)) {
$obj->{$prop} = $val;
$set = 'set' . Formatting::snakeCaseToCamelCase($prop);
$obj->{$set}($val);
} else {
Log::error("Property {$class}::{$prop} doesn't exist");
}