I am a Java programmer and was working on a project using Hibernate and Struts for some time.
Now For my new project, I am working on PHP and Mysql (learning PHP). Is there any technology which is similar to Hibernate for PHP? If yes, can anyone give me the link where I can understand and use it?
Is there a POJO concept in PHP?
MyBatis, Spring, Entity Framework, Sequelize, and SQLAlchemy are the most popular alternatives and competitors to Hibernate.
The Doctrine Project is the home to several PHP libraries primarily focused on database storage and object mapping. The core projects are the Object Relational Mapper (ORM) and the Database Abstraction Layer (DBAL) it is built upon.
An ORM is an abstraction that is supposed to simplify working with a relational database in an object oriented language. It's basically a set of classes and methods that let you create, retrieve and update data without using SQL directly.
No, there is no way that Hibernate is deprecated. There is the JPA which is a persistence specification and Hibernate implements it. Also Hibernate has its own advanced features that JPA does not have and that's why Hibernate is the main source of new features that are added to the JPA standard.
If you need ORM, you can try Doctrine
In my opinion the best ORM for PHP is Doctrine.
You may also wish to check out Propel and see which suits your style better.
PHP ORMs: Doctrine vs. Propel is a recent SO question comparing the two. Common PHP frameworks like Symfony let you use either ORM as far as I recall.
As far as POJOs, as far as I know you'd use stdClass for that in PHP. I'm not much with Java though, so I can't say for sure. Here's an SO Question about that... What is stdClass in PHP?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With