2725 search results for Doctrine

i already run the composer require doctrine/doctrine-migrations-bundle "^3.0". But when trying again the php bin/console make:migration still come up with the [ERROR] Missing package: to use the make:migration command ...
Charlene Eboña
Charlene Eboña
Read Full Comment
Hey jpfortuno As far as I know, Doctrine refactored its namespace in a recent version. The old namespace is `Doctrine\Common\Persistence\ObjectManager` and now you should use the other one. I believe they didn't change any behavior Cheers! ...
MolloKhan
MolloKhan
Read Full Comment
For Symfony 5, use the Doctrine Paginator https://www.doctrine-project.org/projects/doctrine-orm/en/2.7/tutorials/pagination.html - Fabien's book (section 10.6 Paginating the Comments) has the example which matches this chapter fairly closely. ...
Edward B.
Edward B.
Read Full Comment
Thank you anyways, I found the answer to my question here https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/basic-mapping.html#identifiers-primary-keys so it is within doctrine document. ...
A little bit more details: Uncaught PHP Exception ErrorException: "Notice: Undefined index: 000000002e4d2d6e0000000027619249" at /vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php line 2997 this is about these lines ...
... Yes, it's possible but it's a feature coming from Doctrine actually. Give it a check to this docs: https://www.doctrine-project.org/projects/doctrine-orm/en/2.6/reference/transactions-and-concurrency.html
MolloKhan
MolloKhan
Read Full Comment
Hey Ahmed, Could you clarify what exactly "Doctrine extension Bundle"? Yes, StofDoctrineExtensionsBundle requires "gedmo/doctrine-extensions" package as the bundle is just a wrapper for that library that has integration with Symfony if you mean this. Cheers! ...
Hey radone! Indeed - looks like a bug with Doctrine and Mariadb - thanks for sharing. I'd be interested if the last link / solution works. It's unfortunate, either way - Doctrine usually does this stuff *really* well. Cheers! ...
weaverryan
weaverryan
Read Full Comment
... btw, if I'm not mistaken, the same problem occurs with the codebase of previous tutorial 'Doctrine & The Database' https://symfonycasts.com/screencast/symfony-doctrine/install; but I'm not 100% sure about it
Yaroslav Y.
Yaroslav Y.
Read Full Comment
Hello, i am getting this error: Fatal error: Uncaught exception 'PDOException' with message 'could not find driver' in /usr/share/nginx/html/test/rest/rest/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:40 Stack trace: #0 ...
Hey Jorge Yeah, testing in Symfony4 got a bit weirder... but anyways, you only have to tweak your Doctrine config for your test environment, like this: ``` // config/packages/test/doctrine.yaml doctrine: dbal: url: '%env(resolve:DATABASE_URL)%_test' ``` Cheers! ...
MolloKhan
MolloKhan
Read Full Comment
25 lines | src/DataFixtures/AppFixtures.php
// ... lines 1 - 2
namespace App\DataFixtures;
use App\Entity\Question;
use App\Factory\QuestionFactory;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
class AppFixtures extends Fixture
{
public function load(ObjectManager $manager)
{
QuestionFactory::createMany(20);
QuestionFactory::new()
->unpublished()
->many(5)
->create()
;
$manager->flush();
}
}
See Code Block in Script
18 lines | src/DataFixtures/AppFixtures.php
// ... lines 1 - 2
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class AppFixtures extends Fixture
{
public function load(ObjectManager $manager)
{
// $product = new Product();
// $manager->persist($product);
$manager->flush();
}
}
See Code Block in Script
18 lines | src/DataFixtures/TagFixture.php
// ... lines 1 - 2
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class TagFixture extends Fixture
{
public function load(ObjectManager $manager)
{
// $product = new Product();
// $manager->persist($product);
$manager->flush();
}
}
See Code Block in Script
18 lines | src/DataFixtures/UserFixture.php
// ... lines 1 - 2
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class UserFixture extends Fixture
{
public function load(ObjectManager $manager)
{
// $product = new Product();
// $manager->persist($product);
$manager->flush();
}
}
See Code Block in Script
18 lines | src/DataFixtures/CommentFixture.php
// ... lines 1 - 2
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class CommentFixture extends Fixture
{
public function load(ObjectManager $manager)
{
// $product = new Product();
// $manager->persist($product);
$manager->flush();
}
}
See Code Block in Script
95 lines | src/AppBundle/Entity/User.php
// ... lines 1 - 12
class User implements UserInterface
{
// ... lines 15 - 86
public function setPlainPassword($plainPassword)
{
$this->plainPassword = $plainPassword;
// forces the object to look "dirty" to Doctrine. Avoids
// Doctrine *not* saving this entity, if only plainPassword changes
$this->password = null;
}
}
See Code Block in Script
18 lines | src/DataFixtures/ArticleFixtures.php
// ... lines 1 - 2
namespace App\DataFixtures;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Common\Persistence\ObjectManager;
class ArticleFixtures extends Fixture
{
public function load(ObjectManager $manager)
{
// $product = new Product();
// $manager->persist($product);
$manager->flush();
}
}
See Code Block in Script
19 lines | src/ApiResource/UserApi.php
// ... lines 1 - 4
use ApiPlatform\Doctrine\Orm\State\CollectionProvider;
use ApiPlatform\Doctrine\Orm\State\Options;
// ... line 7
use App\Entity\User;
#[ApiResource(
shortName: 'User',
provider: CollectionProvider::class,
stateOptions: new Options(entityClass: User::class),
)]
class UserApi
{
public ?int $id = null;
}
See Code Block in Script
16 lines | src/DataFixtures/AppFixtures.php
// ... lines 1 - 2
namespace App\DataFixtures;
use App\Factory\DragonTreasureFactory;
use Doctrine\Bundle\FixturesBundle\Fixture;
use Doctrine\Persistence\ObjectManager;
class AppFixtures extends Fixture
{
public function load(ObjectManager $manager): void
{
DragonTreasureFactory::createMany(40);
}
}
See Code Block in Script