Creating Objects in Symfony2 without Doctrine

My company supports the administration and development of databases in a separate department, and for my Symfony2 application, I am allowed to interact with the database through the service API. This means that I cannot use Doctrine ORM or even php pdo.

I basically have to create my own level of abstraction. I searched the Internet all day and saw nothing about the best methods for creating my own level of entity abstraction for Symfony2. I cannot even find information on using anything other than the Doctrine.

Does anyone have any suggestions or any resources for best practices for this for symfony2?

+7
source share
3 answers

Symfony is model independent (there is no β€œM” from MVC). Note that Doctrine or Propel are separate projects integrated with Symfony. They are not included in the scope.

I think you just need to implement the client library for your API, which will be separated from the framework (you can even use it in simple php scripts or in other environments).

Step 2 will integrate your library with Symfony. This will likely include the creation of a set and corresponding service definitions. A look at the DoctrineBundle can give you some ideas.

+6
source

I did it as follows:

Please feel free to contact me for more information.

+6
source

It seems to me that the API can be perceived as another DB driver. I believe this doctrine can be extended to accept a custom db driver, but I'm not sure how much effort you will need and whether your API will provide all the necessary functions. The obvious advantages of this approach are that you can use the same doctrine features that you would have if you had access to PDO.

0
source

All Articles