public function __construct(User $model) { $this->id = $model->getId(); $this->fullName = $model->getFullName(); $this->username = $model->getUsername(); }
public function __construct(User $user) { $this->userId = $user->getId(); $this->fullName = $user->getFullname(); $this->username = $user->getUsername(); }
private static function update(User $model) { $db = DatabaseData::getInstance(\RedDevil\Config\DatabaseConfig::DB_INSTANCE); $query = "UPDATE users SET username= :username, email= :email, password= :password, fullname= :fullname, telephone= :telephone WHERE id = :id"; $result = $db->prepare($query); $result->execute([':id' => $model->getId(), ':username' => $model->getUsername(), ':email' => $model->getEmail(), ':password' => $model->getPassword(), ':fullname' => $model->getFullname(), ':telephone' => $model->getTelephone()]); }