1000 search results

21 lines | app/config/config_test.yml
// ... lines 1 - 17
doctrine:
dbal:
dbname: "%database_name%_test"
See Code Block in Script
76 lines | app/config/config.yml
// ... lines 1 - 46
doctrine:
// ... lines 48 - 62
orm:
// ... lines 64 - 65
filters:
fortune_cookie_discontinued: AppBundle\Doctrine\DiscontinuedFilter
// ... lines 68 - 76
See Code Block in Script
Dogtrine .. You rule sir. lol I really like the way you teach. It really motivates me to listen to you. Keep up the good work. P.S : I will surely save some bucks to buy a subscription on this site .. Regards, Kev From Mauritius
42 lines | src/Form/StarshipPartType.php
// ... lines 1 - 7
use Doctrine\ORM\EntityRepository;
// ... lines 9 - 14
class StarshipPartType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options): void
{
$builder
// ... lines 20 - 22
->add('starship', EntityType::class, [
// ... lines 24 - 25
'query_builder' => function (EntityRepository $repo) {
return $repo->createQueryBuilder('starship')
->orderBy('starship.name', Order::Ascending->value);
},
])
// ... line 31
;
}
// ... lines 34 - 40
}
See Code Block in Script
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