nativegallery/app/Models/User.php
2025-02-25 23:02:05 +03:00

21 lines
No EOL
493 B
PHP

<?php
namespace App\Models;
use \App\Services\DB;
class User {
public $userid;
private $user;
function __construct($user_id) {
$this->userid = $user_id;
$this->user = DB::query("SELECT * FROM users WHERE id=:id", array(':id'=>$this->userid))[0];
}
public function i($table) {
return $this->user[$table];
}
public function content($table) {
$content = json_decode(self::i('content'), true);
return $content[$table];
}
}