symfony

Doctrine query using Native SQL always returning empty array

牧云@^-^@ 提交于 2021-02-20 13:32:13
问题 I create a service with methods that run some queries, i want to use doctrine Native SQL but no matter which query i made it always return an empty array. There is something that i'm missing? Method from service MonthVacancySchedule: public function getTotalVacanciesByUnits() { $rsm = new ResultSetMapping(); $sql = 'SELECT nome_procedimento FROM programacao'; $query = $this->emi->createNativeQuery($sql, $rsm); $units = $query->getResult(); return $units; } The controller which i use the

Symfony 3 - How to keep session id after logging in?

久未见 提交于 2021-02-20 00:24:47
问题 I want to use the session ID to identify the records in the database for anonymous user. When the user logs in, I would like to bind/relate the data to the user id. However, after logging in the session id is automatically changed by what I lose data binding with the user. How can I keep the session id after logging in order to bind the user id to the data, and then change the session id? 回答1: Upon authentication, session should be migrated, unless configured otherwise. Indeed, the session ID

Symfony 3 - How to keep session id after logging in?

限于喜欢 提交于 2021-02-20 00:21:52
问题 I want to use the session ID to identify the records in the database for anonymous user. When the user logs in, I would like to bind/relate the data to the user id. However, after logging in the session id is automatically changed by what I lose data binding with the user. How can I keep the session id after logging in order to bind the user id to the data, and then change the session id? 回答1: Upon authentication, session should be migrated, unless configured otherwise. Indeed, the session ID

Symfony 3 - How to keep session id after logging in?

牧云@^-^@ 提交于 2021-02-20 00:20:26
问题 I want to use the session ID to identify the records in the database for anonymous user. When the user logs in, I would like to bind/relate the data to the user id. However, after logging in the session id is automatically changed by what I lose data binding with the user. How can I keep the session id after logging in order to bind the user id to the data, and then change the session id? 回答1: Upon authentication, session should be migrated, unless configured otherwise. Indeed, the session ID

Send email containing login and pass after registration

ε祈祈猫儿з 提交于 2021-02-19 07:20:57
问题 I am currently working on a Symfony2 project for managing user I installed the bundle FosUserBundle which is functional but I can not find how to send an email containing the username and password immediately after creating user, as I said I have two user: admin and user type, and it is the admin who will create the users with a form of creation that is the form of FOS Registration, changing between the two kind user is only the roles. 回答1: You could hook into the EventDispatcher and send

Send email containing login and pass after registration

被刻印的时光 ゝ 提交于 2021-02-19 07:18:48
问题 I am currently working on a Symfony2 project for managing user I installed the bundle FosUserBundle which is functional but I can not find how to send an email containing the username and password immediately after creating user, as I said I have two user: admin and user type, and it is the admin who will create the users with a form of creation that is the form of FOS Registration, changing between the two kind user is only the roles. 回答1: You could hook into the EventDispatcher and send

set Nelmio ApiDoc return parameter description

拈花ヽ惹草 提交于 2021-02-19 07:16:25
问题 On the ApiDoc for our controller we have specified the output response object and now we see a list of all the parameters that get returned. How do we provide values for the version and/or description fields on this list? I have tried adding @ApiDoc(description="text") to the response object's parameters but that doesn't seem to be doing anything. Thanks in advance. 回答1: I stepped through the ApiDocBundle today and see that Description comes from the comment on the model property or method

How to hide or delete the defaults available console commands?

家住魔仙堡 提交于 2021-02-19 05:37:59
问题 I created a new Symfony 4 project via symfony new my_project_name . Currently when I execute ./bin/console , the output shows I will create some custom console commands and I want show only my custom commands when I do ./bin/console Maybe I should create a custom executable 'console' from scratch, but I don't know how do that. 回答1: You are creating a complete Symfony application, so all the commands provided by the included packages are available. Instead of starting from a framework and

Symfony2 - Dynamic Role Management

女生的网名这么多〃 提交于 2021-02-19 04:28:25
问题 I'm working on a CRM which will feature advanced authorization and the management of users in groups that have a specific role in the system. Basically, what I'd like to do is this: Manage Dynamic Authorization for (Domain) Models / Controllers / Action Manage Dynamic Authorization For Objects and Fields. I know about ROLE_xxxx in the security.yml file but I'd rather not hardcode the roles. For example, I'd like to have a sort of matrix/grid where a super administrator can create custom

Add custom options to symfony form

倖福魔咒の 提交于 2021-02-19 01:41:26
问题 1 What i want to do is add custom (option is 'angular' in this case)option to my form widget template: {%- block widget_attributes -%} id="{{ id }}" name="{{ full_name }}" {%- if angular %} ng-model="{{ full_name }}"{% endif -%} .... {%- if intention %} {{ intention }}{% endif -%} {%- if read_only %} readonly="readonly"{% endif -%} ..... {%- endblock widget_attributes -%} I wand to decide about form has it option or no in my CustomFormType. But i can't achieve it. I tried different method. Is