2024-07-03 14:41:15 +03:00
|
|
|
<?php
|
|
|
|
namespace Controllers;
|
|
|
|
use Models\User;
|
|
|
|
use Models\Question;
|
|
|
|
|
|
|
|
class Users {
|
2024-07-03 15:15:59 +03:00
|
|
|
public function actionCreateUser($username, $email, $password)
|
2024-07-03 14:41:15 +03:00
|
|
|
{
|
|
|
|
return User::create(['username'=>$username,'email'=>$email,'password'=>$password]);
|
|
|
|
}
|
|
|
|
|
2024-07-03 15:15:59 +03:00
|
|
|
public function actionQuestionCount($user_id)
|
2024-07-03 14:41:15 +03:00
|
|
|
{
|
|
|
|
return Question::where('user_id', $user_id)->count();
|
|
|
|
}
|
|
|
|
}
|