Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Rijke parijke

  • Jávea Spain
View GitHub Profile
@parijke
parijke / Login.php
Created Jan 14, 2020 — forked from kunicmarko20/Login.php
Symfony OAuth with Leage OAuth2 library
View Login.php
<?php
declare(strict_types=1);
namespace App;
use Symfony\Component\HttpFoundation\Response;
use Twig\Environment;
use League\OAuth2\Client\Provider\Google as GoogleProvider;
@parijke
parijke / TodoSubscriber
Created Jun 20, 2020
Todo EVent Subscriber
View TodoSubscriber
<?php
namespace App\EventSubscribers;
use App\Entity\Todo;
use Doctrine\Common\EventSubscriber;
use Doctrine\ORM\Events;
use Doctrine\Common\Persistence\Event\LifecycleEventArgs;
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;
@parijke
parijke / EntityIdTrait.php
Created Aug 20, 2020
Symfony Uid as primary identifier
View EntityIdTrait.php
<?php
namespace App\Entity\Traits;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
trait EntityIdTrait
{
/**
View UuidGenerator.php
<?php
namespace App\Entity\Generator;
use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Id\AbstractIdGenerator;
use Symfony\Component\Uid\Uuid;
class UuidGenerator extends AbstractIdGenerator
{
@parijke
parijke / Test.php
Created Aug 20, 2020
Use the EntityIdTrait
View Test.php
<?php
namespace App\Entity;
use App\Entity\Traits\EntityIdTrait;
use App\Repository\TestRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TestRepository::class)
You can’t perform that action at this time.