phpdoctrine: a php or mapper
I am about to construct a page for a friend. It’s about a german car racing series called “Spezial Tourenwagen Trophy”. Due to I am tired of writing all the PHP stuff by my own, I ve been searching for an OR Mapper and found php doctrine, which runs with PHP 5.2.2+. Unfortunatelly the webspace does not provide PDO with mysql so I had to switch to sqlite3.
php doctrine has a lean documentation, but most things are working as excepted and the system requirements match with the support of the webspace, so why should I switch? In addition I had to deal with yaml,yet another markup language - or as it is called today “YAML Ain’t Markup Language”. So you can easily declare your models like this:
Location:
columns:
id:
type: integer(4)
primary: true
name:
type: string(120)
country:
type: string(120)
And use it in your PHP code:
$locs = Doctrine_Query::create()
->from('location l')
->orderBy('name ASC')
->execute();