nativegallery-weryskok/app/Models/User.php

19 lines
443 B
PHP
Raw Permalink Normal View History

2024-07-05 06:09:25 +03:00
<?php
namespace App\Models;
use \App\Services\DB;
class User {
public $userid;
function __construct(int $user_id) {
$this->userid = $user_id;
}
public function i($table) {
return DB::query("SELECT * FROM users WHERE id=:id", array(':id'=>$this->userid))[0][$table];
}
2024-07-05 06:33:46 +03:00
public function content($table) {
$content = json_decode(self::i('content'), true);
return $content[$table];
}
2024-07-05 06:09:25 +03:00
}