0

I am starting with PHP DATAMAPPER AND ORM.. I am completely new with it. Though I got knowledge about through google. It really found interesting.

I have few doubts with it.

  1. Can I use Doctrine 2 library/ORM with my Core PHP Project. Or it is only for framework like CodeIgnitor, Zend or else.
  2. Is it really helpful for fast development. Or it may get expanded after some extent.
  3. Can I have any example/ esp. tutorial where I can implement it with CORE PROJECT means some blog or else.

  4. I checked with phpdatamapper.com. I found it easy but it was quite old as not updated since last 3 years. Is it good to implement that ? Any source implement that.

I would really be pleased having source/implementation (simply on blog) on github or else somewhere. Please

Sankalp
  • 1,300
  • 5
  • 28
  • 52

1 Answers1

1

ORM like doctrine can be used with every project, it does not need any framework. You can include them in your projects with composer. About Doctrine, you can use two things depending on what you want to do :

  • Doctrine\ORM and its whole bundle. It brings you the whole functionality, with its ORM and other cool stufs. If you want to use it, you have to put that line on your composer.json file :

    {"require": 
         {"doctrine/orm": "2.3.2"}
    }
    
  • Doctrine\DBAL. It is only a abstraction layer without the ORM functionality. It is here to bring you more functionalities to PDO, and build queries without taking care of your data base engine. As it has no ORM it is faster to execute but it does not bring any conception facility.

If I introduce you to these two tools it is because you will have a choice to make. If you want a simple blog site, Doctrine\DBAL is what you want as it will bring no performance issue. If you want a bigger application with a full architecture, you need Doctrine\ORM as it will help you to build and keep your data base safe.

About tutorials, the documentation is built like one so I think you can get started here for the ORM and here for Doctrine\DBAL

artragis
  • 3,677
  • 1
  • 18
  • 30