36

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?

Mat
  • 202,337
  • 40
  • 393
  • 406
gmhk
  • 15,598
  • 27
  • 89
  • 112

4 Answers4

32

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?

Community
  • 1
  • 1
JAL
  • 21,295
  • 1
  • 48
  • 66
9

If you need ORM, you can try Doctrine

darja
  • 4,985
  • 9
  • 33
  • 47
5

If you're not stuck on PHP (e.g. you can use any scripting language), Perl has both POJO concept (Perl objects) and Hibernate alternatives (including hibernate Perl port; and several Object-Relational Mapping classes).

If you're forced into PHP, you can see alist of OR/M for PHP here

DVK
  • 126,886
  • 32
  • 213
  • 327
2

There is also dmz as a doctrine alternative: http://datamapper.wanwizard.eu/ which is very simple to setup and made to work with codeigniter.

Flavien Volken
  • 19,196
  • 12
  • 100
  • 133