Skip to content
Advertisement

Tag: symfony

The Symfone “doctrine:fixtures:load” command missing

I have Symfony 3.1 project with Doctrine and doctrine/doctrine-fixtures-bundle and doctrine/data-fixtures installed. However, when i run a console command php bin/console doctrine:fixtures:load i get a message saying that there are no commands defined in the doctrine:fixtures namespace. The class DoctrineBundleFixturesBundleCommandLoadDataFixturesDoctrineCommand exists. Please suggest how to fix that. Answer Run first php bin/console and see if the command appear in the

Groups Annotations don’t works

Symfony 3.1.7 + FOSRestBundle latest version Then in my Article entity I added this annotation @Groups({“article”}) with the right use statement. Whit default serializer I get : Whit JMS serializer (bundle) I get : (I have two articles in db) it seems like the “article” group is not recognized. When I use the default serializer whithout this annotations I get

range Symfony form input

I’m looking for something to make this kind of input in Symfony: I don’t know which kind of input and how to deal with the Symfony controller. Here is a part of my controller but not sure it’s useful. Answer If you want to represent a start date linked to an end date, I’d advise you to create two DateType

Doctrine Extensions Sortable not working correctly when changing position by more than 1

Im using Symfony 3.1 + Doctrine GEDMO extensions (via StofDoctrineExtensionsBundle). I’ve set my entity to have Sortable behavior: When i proceed to change position by one the sorting behavior is acting OK: But when I’ve implemented JS drag&drop to change positions the whole thing gets weird. For example, having this table: when I do for row with id 6 this:

Allow any option passed to Symfony CLI

The goal is to allow any options to be passed to symfony CLI, rather than limiting to a defined set of allowed options. For instance: In this example, foo is an option which is not explicitly allowed by the symfony application. My console app is proxying to a different application with a number of CLI options. I do not want

logged user does not have all fields filled up

I’m using Symfony 2.8 and Doctrine and I have security.yml configured to point to the User class which implements UserInterface. My ORM schema is in YAML. The problem: In database the user has also specified “email” field, Symfony for LOGGED USER is not filling up that field and also “password” field is empty. When I do $this->get(‘doctrine.orm.entity_manager’)->clear(User::class); then the entity

Multiple commands in Symfony Process Component

I’m trying to execute multiple commands using Symfony Process Component but second command is not being processed. What am I doing wrong? Answer Process are isolated, the second will not be executed inside the ssh session you open at the top of your code. You must use only one process todo that.

Advertisement