2709 search results for Doctrine

... many changes to its structure and what you just said is one of them, they split the `Doctrine\Common` package into different ones. You can learn more about those changes in this video: https://symfonycasts.com/screencast/symfony5-upgrade/doctrine-bundle-2.0 (and the subsequent one) Cheers!
MolloKhan
MolloKhan
Read Full Comment
Hi victor I upgraded from 2.2.0 to "doctrine/doctrine-fixtures-bundle": "2.4.*@dev", but still no luck. It is ok I will give up on this one since it is not worth the time. Instead I will just listen to the video and ...
... - 'ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter' # I'm not sure how you would pass a filter with options. Maybe this? ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter: properties: [{title: partial}] ``` Let me know if it works :). Cheers!
weaverryan
weaverryan
Read Full Comment
I keep getting this error ```[Doctrine\DBAL\Exception\ConnectionException] An exception occured in driver: SQLSTATE[HY00 0] [2002] No connection could be made because the target machine actively refused it ...
Hey Igor! This is the 2nd episode in the Symfony 3 series after knpuniversity.com/screencast/symfony, which we're just finishing now. My hope is to get this episode this month. In the mean time, Doctrine hasn't changed ...
weaverryan
weaverryan
Read Full Comment
... but it works in EntityType only IIRC. If it does not fit for you - take a look at Doctrine Criteria, we even have an example about them: https://symfonycasts.com/screencast/collections/criteria-collection-filtering https://symfonycasts.com/screencast/doctrine-relations/collection-criteria I hope this helps! Cheers!
Found the solution. I was previously using regular Doctrine Fixtures, so having a look at this excerpt https://github.com/hautelook/AliceBundle/blob/master/src/Resources/doc/doctrine-fixtures-bundle.md found that ...
danresmejia
danresmejia
Read Full Comment
This video explains better than the one in the Doctrine document. Their examples are terrible and the explanation does not make sense: https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/association ...
Hi, I am new to symfony. Started learning. I am using windows environmnet. Sysmfony 2.6 version. While trying ot create entity getting error as below. [Doctrine\DBAL\Exception\ConnectionException] An exception ...
Sekhar M.
Sekhar M.
Read Full Comment
Regarding same error ("Could not find any fixture services to load") when you use Symfony 3.4: to solve it, you just need to have the fixtures class extend the Doctrine\Bundle\FixturesBundle\Fixture class instead of ...
Victor N.
Victor N.
Read Full Comment
Hi Guys, you mention about doctrine migrations being a safer way for renaming the table columns, but how would you make sure that update schema does not break your database? In other words how do you tell update schema ...
Theravadan
Theravadan
Read Full Comment
At around the 5:58 mark, you say we could add a "setComments" method. That implies replacing the ArrayCollection with a new one. The Doctrine docs say you cannot do this - the ArrayCollection is managed by 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
where i can find the next mentioned tutorial about doctrine? ...