mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 15:13:50 +00:00
add base authorization to person search + improve search ordering
This commit is contained in:
@@ -5,21 +5,20 @@ namespace Chill\CalendarBundle\DataFixtures\ORM;
|
||||
use Chill\CalendarBundle\Entity\CalendarRange;
|
||||
use Chill\MainBundle\DataFixtures\ORM\LoadUsers;
|
||||
use Chill\MainBundle\Entity\User;
|
||||
use Chill\MainBundle\Repository\UserRepository;
|
||||
use DateTimeImmutable;
|
||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||
use Doctrine\Bundle\FixturesBundle\FixtureGroupInterface;
|
||||
use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
|
||||
|
||||
class LoadCalendarRange extends Fixture implements FixtureGroupInterface, OrderedFixtureInterface
|
||||
{
|
||||
|
||||
public function __construct(
|
||||
EntityManagerInterface $em
|
||||
UserRepository $userRepository
|
||||
) {
|
||||
$this->userRepository = $em->getRepository(User::class);
|
||||
$this->userRepository = $userRepository;
|
||||
}
|
||||
|
||||
public function getOrder(): int
|
||||
@@ -37,7 +36,7 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$arr = range(-50, 50);
|
||||
|
||||
|
||||
print "Creating calendar range ('plage de disponibilités')\n";
|
||||
|
||||
$users = $this->userRepository->findAll();
|
||||
@@ -70,7 +69,7 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
||||
->setUser($u)
|
||||
->setStartDate($startEvent)
|
||||
->setEndDate($endEvent);
|
||||
|
||||
|
||||
$manager->persist($calendarRange);
|
||||
}
|
||||
|
||||
@@ -79,4 +78,4 @@ class LoadCalendarRange extends Fixture implements FixtureGroupInterface, Ordere
|
||||
}
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user