Laurent Dinclaux - 2008-10-09 22:39:01
Hi,
I use ORM since a long time now, using my own library.
One big disadvantage of that approach is listing records.
$query = "Select record_id FROM table";
$stmt = $Database->prepare($query);
$stmt->execute($queryValues);
$List = array();
while ( $row = $stmt->fetch(PDO::FETCH_ASSOC) ) {
$List[] = new Object($row['record_id'], $this->Database);
}
This code is damn slow and uses a lot of resources. The array approach of listing records is much faster.
Apart that drawback, Object-Relational Mapping is a must.