A common case when looking for ORM tools like Doctrine is that the database and the code that access it is growing large/complex. A more substantial tool is needed then manual SQL code.
Doctrine has support for generating Doctrine_Record classes from your existing database. There is no need for you to manually write all the Doctrine_Record classes for your domain model.
+++ Making the first import
Let's consider we have a mysql database called test with a single table called 'file'.
The file table has been created with the following sql statement:
<code type="sql">
CREATE TABLE file (
id INT UNSIGNED AUTO_INCREMENT NOT NULL,
name VARCHAR(150),
size BIGINT,
modified BIGINT,
type VARCHAR(10),
content TEXT,
path TEXT,
PRIMARY KEY(id))
</code>
Now we would like to convert it into Doctrine record class. It can be achieved easily with the following code snippet: