2726 search results for Doctrine

Being a sf + doctrine user for years I could not believe I would learn anything new - I just went for the badge, but you proved me wrong. I still learned a thing or two. Great job guys! ...
Good afternoon. There is a problem. In the filter, I do not get the parameter from eventlistener. The problem is then I don`t use controller. What to do. Doctrine filter work before event listener. Thanks. P.S. Sorry my english -) ...
WarGot Georg
WarGot Georg
Read Full Comment
Hello, why are you using Doctrine Fixtures not Hautelook Fixtures (https://github.com/hautelook/AliceBundle)? In Symfony 3 tutorial you used it and it was g8. Why did you change it? Sth happened? ...
Dominik P.
Dominik P.
Read Full Comment
Do you think it's a good idea to get help from another PHP library to add createdAt and updatedAt where we can do the same with Doctrine Lifecycle (PrePost, preUpdate)? ...
ahmadmayahi
ahmadmayahi
Read Full Comment
weaverryan `rm -Rf vendor/*; composer install` did the work. Now I can run `./bin/console debug:config doctrine` in ease. Regarding my app, it is 100% copied from `finish` folder of Symfony Security track. ...
... Hey orys You're correct, Doctrine migrations are great! and yes, they are a must when you decide to go to production, you should never update your DB schema by using `doctrine:schema:update` command Cheers!
MolloKhan
MolloKhan
Read Full Comment
Hey fahani! Yep! It's nothing to worry about. There is some deprecation things happening right now... which should go away when doctrine/orm releases their next version. You can happily ignore this ;). Cheers! ...
weaverryan
weaverryan
Read Full Comment
He @shing You are correct, if you are not using the default folder for your entities, then you will have to specify where they live so Doctrine can find them and do its job :) Cheers! ...
MolloKhan
MolloKhan
Read Full Comment
Hello. Help me please. I have the entities - User, FacebookUser, GoogleUser. FacebookUser and GoogleUser must extend User entity.

 Is it possible to implement this with the help of Doctrine ORM? How can I extend entities in Symfony? ...
Hey Trafficmanagertech , You're right, if you do not use doctrine/common directly in your project - just upgrade deps in the future and this error will be gone. Thanks for sharing the link btw! Cheers! ...
Hey Shaun T. That config only works when working on PHPUnit, you need to specify your test database in your test doctrine.yaml file. ``` // config/packages/test/doctrine.yaml doctrine: dbal: url: '%env(resolve:DATABASE_URL)%_test' ``` Cheers! ...
MolloKhan
MolloKhan
Read Full Comment
In my app I am using Doctrine Blameable Extension, so it sets the current user when creating a post on the createdBy field. How can I handle this when running my tests? ...
93 lines | src/Controller/QuestionController.php
// ... lines 1 - 6
use Doctrine\ORM\EntityManagerInterface;
// ... lines 8 - 12
class QuestionController extends AbstractController
{
// ... lines 15 - 35
public function new(EntityManagerInterface $entityManager)
{
// ... lines 38 - 57
$entityManager->persist($question);
$entityManager->flush();
return new Response(sprintf(
'Well hallo! The shiny new question is id #%d, slug: %s',
$question->getId(),
$question->getSlug()
));
}
// ... lines 67 - 91
}
See Code Block in Script
64 lines | src/Controller/QuestionController.php
// ... lines 1 - 10
class QuestionController extends AbstractController
{
// ... lines 13 - 25
public function homepage()
{
// ... line 28
}
// ... line 30
/**
* @Route("/questions/new")
*/
public function new()
{
return new Response('Time for some Doctrine magic!');
}
/**
* @Route("/questions/{slug}", name="app_question_show")
*/
public function show($slug, MarkdownHelper $markdownHelper)
{
// ... lines 44 - 61
}
}
See Code Block in Script
// ... lines 1 - 5
use ApiPlatform\Core\Bridge\Doctrine\Orm\Extension\QueryItemExtensionInterface;
// ... lines 7 - 11
class CheeseListingIsPublishedExtension implements QueryCollectionExtensionInterface, QueryItemExtensionInterface
{
// ... lines 14 - 25
public function applyToItem(QueryBuilder $queryBuilder, QueryNameGeneratorInterface $queryNameGenerator, string $resourceClass, array $identifiers, string $operationName = null, array $context = [])
{
// ... line 28
}
// ... lines 30 - 44
}
See Code Block in Script
// ... lines 1 - 6
use App\Service\UploaderHelper;
use Doctrine\ORM\EntityManagerInterface;
// ... line 9
use Symfony\Component\HttpFoundation\File\UploadedFile;
// ... lines 11 - 13
class ArticleReferenceAdminController extends BaseController
{
// ... lines 16 - 19
public function uploadArticleReference(Article $article, Request $request, UploaderHelper $uploaderHelper, EntityManagerInterface $entityManager)
{
/** @var UploadedFile $uploadedFile */
$uploadedFile = $request->files->get('reference');
// ... lines 24 - 37
}
}
See Code Block in Script
imports:
- { resource: config.yml }
#framework:
# validation:
# cache: validator.mapping.cache.apc
# serializer:
# cache: serializer.mapping.cache.apc
#doctrine:
# orm:
# metadata_cache_driver: apc
# result_cache_driver: apc
# query_cache_driver: apc
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
See Code Block in Script
39 lines | app/config/services.yml
// ... lines 1 - 8
services:
// ... lines 10 - 13
AppBundle\Service\MarkdownTransformer:
arguments: ['@markdown.parser', '@doctrine_cache.providers.my_markdown_cache']
AppBundle\Twig\MarkdownExtension:
#arguments: ['@app.markdown_transformer']
AppBundle\Security\LoginFormAuthenticator: ~
AppBundle\Doctrine\HashPasswordListener:
tags:
- { name: doctrine.event_subscriber }
AppBundle\Form\TypeExtension\HelpFormExtension:
tags:
- { name: form.type_extension, extended_type: Symfony\Component\Form\Extension\Core\Type\FormType }
// ... lines 29 - 39
See Code Block in Script
41 lines | src/AppBundle/Form/UserEditForm.php
// ... lines 1 - 6
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 8 - 14
class UserEditForm extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... lines 20 - 24
->add('studiedGenuses', EntityType::class, [
'class' => Genus::class,
'multiple' => true,
'expanded' => true,
'choice_label' => 'name',
])
;
}
// ... lines 33 - 39
}
See Code Block in Script
60 lines | src/AppBundle/Form/GenusFormType.php
// ... lines 1 - 7
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
// ... lines 9 - 16
class GenusFormType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
// ... lines 22 - 44
->add('genusScientists', EntityType::class, [
'class' => User::class,
'multiple' => true,
'expanded' => true,
])
;
}
// ... lines 52 - 58
}
See Code Block in Script