webcron/src/Repository/UserRepository.php

28 lines
567 B
PHP
Raw Normal View History

2021-04-08 12:54:49 +02:00
<?php
2022-04-27 14:24:48 +02:00
namespace App\Repository;
2021-04-08 12:54:49 +02:00
2022-09-08 12:28:38 +02:00
use App\Entity\User;
2022-04-27 14:24:48 +02:00
use App\Service\Secret;
use Doctrine\ORM\EntityRepository;
2021-04-08 12:54:49 +02:00
2022-04-27 14:24:48 +02:00
class UserRepository extends EntityRepository
2021-04-08 12:54:49 +02:00
{
2022-09-08 12:28:38 +02:00
public function setLocale(User $user, $locale)
{
$em = $this->getEntityManager();
$user->setLocale($locale);
$em->persist($user);
$em->flush();
}
2022-09-08 12:28:38 +02:00
public function setPassword(User $user, $hashedPassword)
{
$em = $this->getEntityManager();
$user->setPassword($hashedPassword);
$em->persist($user);
$em->flush();
}
2021-04-08 12:54:49 +02:00
}