From 1ae09931b2572d9c3067c99f841a60cb3330b3f3 Mon Sep 17 00:00:00 2001 From: wei <> Date: Thu, 3 May 2007 00:48:04 +0000 Subject: Update active relations docs --- .../protected/pages/Database/ActiveRecord.page | 29 ++++++++++++++++----- .../protected/pages/Database/ar_objects.png | Bin 0 -> 14323 bytes .../protected/pages/Database/ar_objects.vsd | Bin 0 -> 183296 bytes .../protected/pages/Database/ar_relations.png | Bin 0 -> 9278 bytes .../protected/pages/Database/ar_relations.vsd | Bin 0 -> 97280 bytes 5 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 demos/quickstart/protected/pages/Database/ar_objects.png create mode 100644 demos/quickstart/protected/pages/Database/ar_objects.vsd create mode 100644 demos/quickstart/protected/pages/Database/ar_relations.png create mode 100644 demos/quickstart/protected/pages/Database/ar_relations.vsd (limited to 'demos') diff --git a/demos/quickstart/protected/pages/Database/ActiveRecord.page b/demos/quickstart/protected/pages/Database/ActiveRecord.page index c3cf663b..967aae89 100644 --- a/demos/quickstart/protected/pages/Database/ActiveRecord.page +++ b/demos/quickstart/protected/pages/Database/ActiveRecord.page @@ -49,15 +49,20 @@
  • Finder methods to wrap commonly used SQL queries and return Active Record objects.
  • Update existing records and insert new records into the database.
  • +

    Database Supported

    The Active Record implementation utilizes the Prado DAO classes for data access. -The current Active Record implementation supports -MySQL, -Postgres SQL and -SQLite databases. -Support for other databases can be provided when there are sufficient demand. +The current Active Record implementation supports the following database.

    -

    Defining an Active Record

    + +

    Support for other databases can be provided when there are sufficient demand.

    + +

    Defining an Active Record

    Let us consider the following "users" table that contains two columns named "username" and "email", where "username" is also the primary key. @@ -412,6 +417,18 @@ catch(Exception $e) // an exception is raised if a query fails } +

    Active Record Relationships

    +

    +The Prado ActiveRecord implementation supports the foreign key mappings for database +that supports foreign key contraints. For ActiveRecord relationships to function the +underlying database must support foreign key constraints (e.g. MySQL with InnoDB). +

    + +

    Foreign Key Mapping

    + + +

    Association Table Mapping

    +

    References