2708 search results for Doctrine

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
22 lines | docker-compose.yml
version: '3'
services:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-13}-alpine
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-ChangeMe}
POSTGRES_USER: ${POSTGRES_USER:-symfony}
volumes:
- db-data:/var/lib/postgresql/data:rw
// ... lines 14 - 22
See Code Block in Script
Hey Cesar, With Doctrine you get both ORM and DBAL. We explain ORM in this course, it's higher level and more fun. However, ORM is based on the more lower level like DBAL. Actually, you can think of Doctrine DBAL as ...
Ah hah! I got it, finally! The tutorial uses doctrine/dbal 2.5.4, and there is a behavior change in doctrine/dbal 2.5.5! Here is the issue about it: https://github.com/doctrine/dbal/issues/2501 So, it's quite an ...
weaverryan
weaverryan
Read Full Comment
... /code-symfony5-doctrine/code-symfony5-doctrine/start/vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php on line 3 Fatal error: Cannot declare interface Stringable, because the name is already in use in /Users ...
Hi, i saw the same problem like Aaroon kincer the problem is ``` composer require stof/doctrine-extensions-bundle ``` Using version ^1.6 for stof/doctrine-extensions-bundle ./composer.json has been updated Running ...
... \FrameworkExtraBundle\Request\ParamConverter\DoctrineParamConverter::__construct() must be an instance of Doctrine\Common\Persistence\ManagerRegistry or null, instance of Doctrine\Bundle\DoctrineBundle\Registry given, called in C:\\var ...
Hi Andres M! Yes, you're right! So, there are 3 different types of caches in Doctrine: metadata, query and result caches. The first 2 - metadata & cache - make complete sense to have enabled all the time in production ...
weaverryan
weaverryan
Read Full Comment
... Symfony\Comp !! onent\Form\FormTypeGuesserInterface not found in /Users/john_christensen/Do !! wnloads/code-symfony-doctrine/start/vendor/symfony/doctrine-bridge/Form/Doc !! trineOrmTypeGuesser.php:25 ...
... ( * nullable=false * ) * */ private $product; The full stack trace (the original one): Doctrine\ORM\ORMInvalidArgumentException: Multiple non-persisted new entities were found through the ...
Hey Pawel, First of all, Doctrine has a low level library to interact with DB, see Doctrine DBAL. It's just a wrapper around PDO, which give you some useful benefits. So, instead directly use PDO I'd recommend Doctrine ...
... ", "symfony/framework-bundle": "^4.0", "symfony/lts": "^4@dev", "symfony/yaml": "^4.0", "doctrine/doctrine-bundle": "^1.6", "doctrine/doctrine-migrations-bundle": "^1.2", "doctrine ...
Hi Ryan. You do very nice job :) I have a question ( sorry for my weak english ) about Doctrine and ( Ouch ) MsSql :/ sorry :) system must work on MsSql. On my computer i have MsSql express 2017 + Win10 + php 7.3.2 ...
Tomasz N.
Tomasz N.
Read Full Comment
The ManyToOne Relation

Okay: we have a Question entity and table. We have an Answer entity and table. Yay for us! But what we really want to do is relate an Answer to a Question. To do this... well... forget about Doctrine for a second. Let's ...

8:35