TL;DR: how can you add custom constraints (i.e. security voters) to transitions? My application needs some workflow management system, so I’d like to try Symfony’s new Workflow Component. Let’s take a Pull Request workflow as an example. In this example, only states and their transitions are describes. But what if I want to add other constraints to this workflow? I
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
connect Symfony 3 application to an external SQL database in (asterisk server)
I am developing a VoIP administration platform based on asterisk and I am not be able to connect to my asterisk server from a web app developed with Symfony 3. I want to connect to my SQL database existing on asterisk server which is running on virtual machine from my web application and execute some queries like INSERT, UPDATE, SELECT,
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.
How to identify if an option was supplied without a value with Symfony Console?
With the Symfony3 Console, how can I tell when a user supplied an option, but supplied it without a value? As opposed to not supplying the option at all? As an example, take the following console configuration. The command help will illustrate the option as –option[=OPTION], so I can call this the following ways. However, $input->getOption() will return NULL in