Jump to content

Adding 2 columns to the employee table and showing data in the back office


migomax
 Share

Recommended Posts

Hello! 

So this will be quite long so please let me explain what I am trying to do:

My objective is to add 2 columns to the employee table, "Budget_left" and "Date_Budget_Added".  And then ultimately show these 2 in the EDIT PROFILE PAGE in the back office, with the budget showing the budget of that profile.

I have already successfully modified the database which is done during the installation of my module.

I have also overridden the Employee.php to add "Budget_Left" and "Date_Budget_Added" to the Employee class. 

What I now have to do, and where I am quite lost, is to have the correct output on the edit profile page whos templating is done with Symfomy, a framework I am just discovering. 

The output file seems to be: src/PrestaShopBundle/Resources/views/Admin/Configure/AdvancedParameters/Employee/Blocks/form.html.twig.  And I have also successfully overriden this in my module (basically I've copied the whole code) and modifications work on it.

However, my problem now is trying to access the data I need. My "Budget_left" and "Date_Budget_Added" in my database. 

I have var dumped the employeeForm variable however this object doesn't seem to have all the data that is in the employee table in the database.

My question is have I done the correct steps to add the columns to the database? And if so, how can I access these datas from the .twig files?

Thank you all soooo much in advance! I hope I was adequately clear about what I am trying to do!

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More