1000 search results

35 lines | src/Controller/AdminController.php
// ... lines 1 - 6
use Doctrine\ORM\EntityManagerInterface;
// ... lines 8 - 13
class AdminController extends AbstractController
{
#[Route('/starship-part/new', name: 'app_admin_starship_part_new', methods: ['GET', 'POST'])]
public function newStarshipPart(
// ... line 18
EntityManagerInterface $entityManager,
): Response {
// ... lines 21 - 22
if ($form->isSubmitted()) {
/** @var StarshipPart $part */
$part = $form->getData();
$entityManager->persist($part);
$entityManager->flush();
}
// ... lines 29 - 32
}
}
See Code Block in Script
194 lines | src/Entity/Starship.php
// ... lines 1 - 7
use Doctrine\Common\Collections\Criteria;
// ... lines 9 - 14
class Starship
{
// ... lines 17 - 164
public function getExpensiveParts(): Collection
{
$criteria = Criteria::create()->andWhere(Criteria::expr()->gt('price', 50000));
return $this->parts->matching($criteria);
}
// ... lines 171 - 192
}
See Code Block in Script
50 lines | src/Repository/StarshipPartRepository.php
// ... lines 1 - 6
use Doctrine\Common\Collections\Criteria;
// ... lines 8 - 12
class StarshipPartRepository extends ServiceEntityRepository
{
// ... lines 15 - 19
public static function createExpensiveCriteria(): Criteria
{
return Criteria::create()->andWhere(Criteria::expr()->gt('price', 50000));
}
// ... lines 24 - 48
}
See Code Block in Script
182 lines | src/Entity/Starship.php
// ... lines 1 - 6
use Doctrine\Common\Collections\Collection;
// ... lines 8 - 13
class Starship
{
// ... lines 16 - 41
/**
* @var Collection<int, StarshipPart>
*/
#[ORM\OneToMany(targetEntity: StarshipPart::class, mappedBy: 'starship')]
private Collection $parts;
// ... lines 47 - 151
/**
* @return Collection<int, StarshipPart>
*/
public function getParts(): Collection
{
return $this->parts;
}
public function addPart(StarshipPart $part): static
{
if (!$this->parts->contains($part)) {
$this->parts->add($part);
$part->setStarship($this);
}
return $this;
}
public function removePart(StarshipPart $part): static
{
if ($this->parts->removeElement($part)) {
// set the owning side to null (unless already changed)
if ($part->getStarship() === $this) {
$part->setStarship(null);
}
}
return $this;
}
}
See Code Block in Script
182 lines | src/Entity/Starship.php
// ... lines 1 - 5
use Doctrine\Common\Collections\ArrayCollection;
// ... lines 7 - 13
class Starship
{
// ... lines 16 - 47
public function __construct()
{
$this->parts = new ArrayCollection();
}
// ... lines 52 - 180
}
See Code Block in Script
// ... lines 1 - 4
use Doctrine\ORM\EntityManagerInterface;
// ... lines 6 - 10
final class LemonSqueezyWebhookConsumer implements ConsumerInterface
{
public function __construct(
private EntityManagerInterface $entityManager,
){
}
// ... lines 17 - 27
}
See Code Block in Script
103 lines | src/Entity/Category.php
// ... lines 1 - 7
use Doctrine\Common\Collections\Criteria;
// ... lines 9 - 11
class Category
{
// ... lines 14 - 64
public function getFortuneCookiesStillInProduction(): Collection
{
$criteria = Criteria::create()
// ... lines 68 - 70
}
// ... lines 72 - 101
}
See Code Block in Script
102 lines | src/Repository/FortuneCookieRepository.php
// ... lines 1 - 8
use Doctrine\Common\Collections\Criteria;
// ... lines 10 - 19
class FortuneCookieRepository extends ServiceEntityRepository
{
// ... lines 22 - 26
public static function createFortuneCookiesStillInProductionCriteria(): Criteria
{
return Criteria::create()
->andWhere(Criteria::expr()->eq('discontinued', false));
}
// ... lines 32 - 100
}
See Code Block in Script
113 lines | src/Repository/CategoryRepository.php
// ... lines 1 - 7
use Doctrine\ORM\QueryBuilder;
// ... lines 9 - 18
class CategoryRepository extends ServiceEntityRepository
{
// ... lines 21 - 82
private function addFortuneCookieJoinAndSelect(QueryBuilder $qb): QueryBuilder
{
}
// ... lines 87 - 111
}
See Code Block in Script
17 lines | config/bundles.php
// ... lines 1 - 2
return [
// ... lines 4 - 13
Doctrine\Bundle\DoctrineBundle\DoctrineBundle::class => ['all' => true],
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
];
See Code Block in Script
// ... lines 1 - 6
use Doctrine\ORM\EntityManagerInterface;
// ... lines 8 - 10
class TreasuresAllowedOwnerChangeValidator extends ConstraintValidator
{
public function __construct(private EntityManagerInterface $entityManager)
{
}
// ... lines 16 - 40
}
See Code Block in Script
171 lines | src/Entity/User.php
// ... lines 1 - 6
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
// ... lines 9 - 22
class User implements UserInterface, PasswordAuthenticatedUserInterface
{
// ... lines 25 - 50
#[ORM\OneToMany(mappedBy: 'owner', targetEntity: DragonTreasure::class)]
private Collection $dragonTreasures;
public function __construct()
{
$this->dragonTreasures = new ArrayCollection();
}
// ... lines 58 - 140
/**
* @return Collection<int, DragonTreasure>
*/
public function getDragonTreasures(): Collection
{
return $this->dragonTreasures;
}
public function addDragonTreasure(DragonTreasure $treasure): self
{
if (!$this->dragonTreasures->contains($treasure)) {
$this->dragonTreasures->add($treasure);
$treasure->setOwner($this);
}
return $this;
}
public function removeDragonTreasure(DragonTreasure $treasure): self
{
if ($this->dragonTreasures->removeElement($treasure)) {
// set the owning side to null (unless already changed)
if ($treasure->getOwner() === $this) {
$treasure->setOwner(null);
}
}
return $this;
}
}
See Code Block in Script
50 lines | src/Controller/SecurityController.php
// ... lines 1 - 4
use Doctrine\ORM\EntityManagerInterface;
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Totp\TotpAuthenticatorInterface;
// ... lines 7 - 12
class SecurityController extends BaseController
{
// ... lines 15 - 37
public function enable2fa(TotpAuthenticatorInterface $totpAuthenticator, EntityManagerInterface $entityManager)
{
// ... lines 40 - 47
}
}
See Code Block in Script
72 lines | src/Repository/VinylMixRepository.php
// ... lines 1 - 6
use Doctrine\ORM\QueryBuilder;
// ... lines 8 - 17
class VinylMixRepository extends ServiceEntityRepository
{
// ... lines 20 - 42
public function createOrderedByVotesQueryBuilder(string $genre = null): QueryBuilder
{
// ... lines 45 - 51
return $queryBuilder;
}
// ... lines 54 - 70
}
See Code Block in Script
54 lines | src/Controller/VinylController.php
// ... lines 1 - 6
use Doctrine\ORM\EntityManagerInterface;
// ... lines 8 - 12
class VinylController extends AbstractController
{
// ... lines 15 - 39
public function browse(EntityManagerInterface $entityManager, string $slug = null): Response
{
// ... lines 42 - 51
}
}
See Code Block in Script
33 lines | src/Controller/MixController.php
// ... lines 1 - 5
use Doctrine\ORM\EntityManagerInterface;
// ... lines 7 - 10
class MixController extends AbstractController
{
// ... line 13
public function new(EntityManagerInterface $entityManager): Response
{
// ... lines 16 - 22
$entityManager->persist($mix);
$entityManager->flush();
// ... lines 25 - 30
}
}
See Code Block in Script
113 lines | composer.json
{
// ... lines 2 - 5
"require": {
// ... lines 7 - 12
"doctrine/dbal": "^3.3",
// ... lines 14 - 47
},
// ... lines 49 - 111
}
See Code Block in Script
90 lines | src/Controller/RegistrationController.php
// ... lines 1 - 7
use Doctrine\ORM\EntityManagerInterface;
// ... lines 9 - 16
class RegistrationController extends AbstractController
{
// ... line 19
public function register(Request $request, UserPasswordHasherInterface $userPasswordHasher, VerifyEmailHelperInterface $verifyEmailHelper, EntityManagerInterface $entityManager): Response
{
// ... lines 22 - 56
}
// ... lines 58 - 88
}
See Code Block in Script
// ... lines 1 - 4
use Doctrine\ORM\QueryBuilder;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FieldCollection;
use EasyCorp\Bundle\EasyAdminBundle\Collection\FilterCollection;
use EasyCorp\Bundle\EasyAdminBundle\Dto\EntityDto;
use EasyCorp\Bundle\EasyAdminBundle\Dto\SearchDto;
class QuestionPendingApprovalCrudController extends QuestionCrudController
{
public function createIndexQueryBuilder(SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters): QueryBuilder
{
return parent::createIndexQueryBuilder($searchDto, $entityDto, $fields, $filters)
->andWhere('entity.isApproved = :approved')
->setParameter('approved', false);
}
}
See Code Block in Script
// ... lines 1 - 5
use Doctrine\ORM\QueryBuilder;
// ... lines 7 - 22
class UserCrudController extends AbstractCrudController
{
// ... lines 25 - 35
public function createIndexQueryBuilder(SearchDto $searchDto, EntityDto $entityDto, FieldCollection $fields, FilterCollection $filters): QueryBuilder
{
return parent::createIndexQueryBuilder($searchDto, $entityDto, $fields, $filters);
}
// ... lines 40 - 73
}
See Code Block in Script