Good Practices in APIS Rest Full with PHP and Doctrine ORM 2

1

Currently we have a system that uses Doctrine ORM2, we have our Entities, and our DAOS themes, within our DAOS classes we have several methods that we use to make queries, Change, Insert and Delete Data in the database. >

We've created some prefixes for these operations:

  
  • slt = > select

  •   
  • lst = > list

  •   
  • get = > usually search for a specific ID

  •   
  • alt = > change

  •   
  • ins = > insert

  •   
  • del = > delete

  •   

So a name for a method in the Users> class that will insert a new user or search for a specific one on the system would be:

  

insUsuario or getUsuario

So far so good, the problem is that I'm creating an api and wanted to use these DAOS methods already ready to do various operations on the database, I'm using the Slim Framework to help me create api , and I wanted to use DAOS as follows:

  

link

     

link

Where:

  • Where users = > UsuariosDAO
  • Where getUser = > method of the UsersData class

But I researched and read that using method names in an api is not good practice, and I have classes here that have more than 50 different methods, and I do not know what to do because I wanted to use these methods already ready, how could I do this using my methods that are already done in DAOS?

    
asked by anonymous 19.09.2017 / 13:06

1 answer

0

I used the manual that my friend rray pointed out to me, and I went deep into the theory which made me have a greater understanding of how this technology works so as to apply the best programming methods for resolution of my problem.

    
19.06.2018 / 14:23