PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Wednesday, February 16, 2022

[FIXED] Is it possible to use PDO instead of Doctrine in Symfony 4?

 February 16, 2022     pdo, php, symfony     No comments   

Issue

I'm doing a simple MVC web app that is supposed to do different queries to a SQL database. I'm using Symfony 4 as a framework, mostly to take advantage of its routing features.

I know I could take advantage from Doctrine but I was wondering: if someone wants to use PDO instead of Doctrine is it possible to do so and how should it be implemented. Should I make a Database class with PDO that I could pass on to another class?


Solution

Yes, you are not required to use doctrine at all. You can just define your own service with required functionality.

But maybe you could use DBAL which is lower layer used by doctrine to handle creating queries (but doesn't include any ORM functionality).



Answered By - M. Kebza
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing