2725 search results for Doctrine

32 lines | migrations/Version20200709153558.php
// ... lines 1 - 2
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
// ... lines 9 - 12
final class Version20200709153558 extends AbstractMigration
{
// ... lines 15 - 19
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE question ADD created_at DATETIME NOT NULL, ADD updated_at DATETIME NOT NULL');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE question DROP created_at, DROP updated_at');
}
}
See Code Block in Script
32 lines | migrations/Version20200707174149.php
// ... lines 1 - 4
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200707174149 extends AbstractMigration
{
public function getDescription() : string
{
return '';
}
public function up(Schema $schema) : void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE UNIQUE INDEX UNIQ_B6F7494E989D9B62 ON question (slug)');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP INDEX UNIQ_B6F7494E989D9B62 ON question');
}
}
See Code Block in Script
51 lines | src/Repository/UserRepository.php
// ... lines 1 - 2
namespace App\Repository;
use App\Entity\User;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method User|null find($id, $lockMode = null, $lockVersion = null)
* @method User|null findOneBy(array $criteria, array $orderBy = null)
* @method User[] findAll()
* @method User[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class UserRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, User::class);
}
// ... lines 21 - 49
}
See Code Block in Script
51 lines | src/Repository/CommentRepository.php
// ... lines 1 - 2
namespace App\Repository;
use App\Entity\Comment;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Symfony\Bridge\Doctrine\RegistryInterface;
/**
* @method Comment|null find($id, $lockMode = null, $lockVersion = null)
* @method Comment|null findOneBy(array $criteria, array $orderBy = null)
* @method Comment[] findAll()
* @method Comment[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
*/
class CommentRepository extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
{
parent::__construct($registry, Comment::class);
}
// ... lines 21 - 49
}
See Code Block in Script
112 lines | src/Entity/DragonTreasure.php
// ... lines 1 - 2
namespace App\Entity;
use App\Repository\DragonTreasureRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: DragonTreasureRepository::class)]
class DragonTreasure
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\Column(type: Types::TEXT)]
private ?string $description = null;
#[ORM\Column]
private ?int $value = null;
#[ORM\Column]
private ?int $coolFactor = null;
#[ORM\Column]
private ?\DateTimeImmutable $plunderedAt = null;
#[ORM\Column]
private ?bool $isPublished = null;
// ... lines 35 - 110
}
See Code Block in Script
32 lines | migrations/Version20211012201423.php
// ... lines 1 - 4
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211012201423 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user ADD totp_secret VARCHAR(255) DEFAULT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user DROP totp_secret');
}
}
See Code Block in Script
32 lines | migrations/Version20211012235912.php
// ... lines 1 - 4
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20211012235912 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user ADD is_verified TINYINT(1) NOT NULL');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE user DROP is_verified');
}
}
See Code Block in Script
Hey Diego! Hmm, I'm not sure about that, but I would maybe doubt it, because we're telling Doctrine that we basically want to get our event attendee's data, which means it should join all the way over to that table ...
weaverryan
weaverryan
Read Full Comment
Hey Richard , Unfortunately, I don't have an example of it, but for such a big and complex tasks we don't use Doctrine migrations. Well, we do use migrations to actually add a column, like slug one, but also we create ...
... So if you're seeing null, something is misconfigured! So let's get down to debugging this! First, you mentioned that you did an "import DB". Are you referring to this: http://symfony.com/doc/current/doctrine ...
weaverryan
weaverryan
Read Full Comment
... [ new AnnotationToAttribute('Symfony\\Component\\Routing\\Annotation\\Route'), ]) ->withConfiguredRule(NestedAnnotationToAttributeRector::class, [ new NestedAnnotationToAttribute('Doctrine\\ORM\\Mapping\\JoinTable ...
... deprecations but I have one last one left and I would like guidance on how to approach it. These are the last two deprecations that I have left: User Deprecated: YAML mapping driver is deprecated and will be removed in Doctrine ...
Hey |mention:12027| There are a few ways to do that. The first and most complex is by using the `ResultSetMapping` of Doctrine. Here's the docs: https://www.doctrine-project.org/projects/doctrine-orm/en/3.2 ...
MolloKhan
MolloKhan
Read Full Comment
... : ``` "@id": "/api/errors/500", "@type": "hydra:Error", "title": "An error occurred", "detail": "Attempted to load class \"ClassMetadataInfo\" from namespace \"Doctrine\\ORM\\Mapping\".\nDid you forget a \"use ...
Hey @Andromeda, The issue is that Symfony doesn't include annotation reader BTW it wasn't a part of symfony at all, it was part of Doctrine library so the easiest way to get annotations back is install `doctrine ...
... Yo! Yep, you're thinking about it correctly. I'm guessing you get this error if you run the doctrine:schema:update command, or generally try to do anything related to Doctrine? Here's how it works: 1) When the system ...
weaverryan
weaverryan
Read Full Comment
Hey Rango, Hm, why do you install that `doctrine/doctrine-migrations-bundle` package? It's not about Doctrine, it's about migrations actually. Well, OK! Let's go in a different direction. First of all, you need to ...
Yo @ashatou! Yikes! That's an ugly error! This appears to be a bug in DoctrineBundle when used with php 8.1 and it was fixed in DoctrineBundle 2.4.3 - https://github.com/doctrine/DoctrineBundle/issues/1377 ...
weaverryan
weaverryan
Read Full Comment
Hey Bard R.! Ah, sorry about confusing you - that was my fault! Before this tutorial (so between the Doctrine tutorial and this Doctrine relations tutorial), I refactored the JavaScript to use Stimulus. The JavaScript ...
weaverryan
weaverryan
Read Full Comment
Hey Nayte, Yes, you'er right, the flush() will send the query to your DB only when the object is changed - that part is completely handled by Doctrine ORM, Doctrine track all the entities and if any have changes - the ...