From bc3c8c2eb84cdbf39da8f439e41634f86b69e80c Mon Sep 17 00:00:00 2001 From: doctrine Date: Tue, 8 Aug 2006 09:07:55 +0000 Subject: [PATCH] Docs updated --- Doctrine.php | 2 ++ ...asic Components - RawSql - Adding components.php | 13 +++++++++++++ ...arted - Record identifiers - Autoincremented.php | 7 +++++++ ... started - Record identifiers - Introduction.php | 4 ++++ tests/AccessTestCase.php | 4 ++++ tests/BatchIteratorTestCase.php | 6 ++++++ tests/UnitTestCase.php | 7 ++++++- 7 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 manual/codes/Basic Components - RawSql - Adding components.php create mode 100644 manual/codes/Getting started - Record identifiers - Autoincremented.php create mode 100644 manual/docs/Getting started - Record identifiers - Introduction.php diff --git a/Doctrine.php b/Doctrine.php index 15d88364d..b5e2c952a 100644 --- a/Doctrine.php +++ b/Doctrine.php @@ -381,6 +381,8 @@ final class Doctrine { $fp = fopen(self::$path.DIRECTORY_SEPARATOR.'Doctrine.compiled.php', 'w+'); fwrite($fp, ""); fclose($fp); } diff --git a/manual/codes/Basic Components - RawSql - Adding components.php b/manual/codes/Basic Components - RawSql - Adding components.php new file mode 100644 index 000000000..a1ce031d6 --- /dev/null +++ b/manual/codes/Basic Components - RawSql - Adding components.php @@ -0,0 +1,13 @@ +parseQuery("SELECT {entity.*}, {phonenumber.*} + FROM entity + LEFT JOIN phonenumber + ON phonenumber.entity_id = entity.id"); + +$query->addComponent("entity", "Entity"); +$query->addComponent("phonenumber", "Phonenumber"); + +$entities = $query->execute(); +?> diff --git a/manual/codes/Getting started - Record identifiers - Autoincremented.php b/manual/codes/Getting started - Record identifiers - Autoincremented.php new file mode 100644 index 000000000..555c1243f --- /dev/null +++ b/manual/codes/Getting started - Record identifiers - Autoincremented.php @@ -0,0 +1,7 @@ +hasColumn("uid","integer",20,"primary|autoincrement"); + } +} +?> diff --git a/manual/docs/Getting started - Record identifiers - Introduction.php b/manual/docs/Getting started - Record identifiers - Introduction.php new file mode 100644 index 000000000..2965d26eb --- /dev/null +++ b/manual/docs/Getting started - Record identifiers - Introduction.php @@ -0,0 +1,4 @@ +Doctrine supports many kind of identifiers. For most cases it is recommended not to +specify any primary keys (Doctrine will then use field name 'id' as an autoincremented +primary key). When using table creation Doctrine is smart enough to emulate the +autoincrementation with sequences and triggers on databases that doesn't support it natively. diff --git a/tests/AccessTestCase.php b/tests/AccessTestCase.php index d1cb139e0..5287101c5 100644 --- a/tests/AccessTestCase.php +++ b/tests/AccessTestCase.php @@ -1,6 +1,10 @@ tables = array("Entity", "User"); + parent::prepareTables(); + } public function testOffsetMethods() { $user = new User(); $this->assertEqual($user["name"],null); diff --git a/tests/BatchIteratorTestCase.php b/tests/BatchIteratorTestCase.php index 0cd7d734f..fe9529df7 100644 --- a/tests/BatchIteratorTestCase.php +++ b/tests/BatchIteratorTestCase.php @@ -2,6 +2,12 @@ require_once("UnitTestCase.php"); class Doctrine_BatchIteratorTestCase extends Doctrine_UnitTestCase { + + public function prepareTables() { + $this->tables = array("Entity", "User","Group","Address","Phonenumber"); + parent::prepareTables(); + } + public function testIterator() { $graph = new Doctrine_Query($this->session); $entities = $graph->query("FROM Entity"); diff --git a/tests/UnitTestCase.php b/tests/UnitTestCase.php index 98741423f..991ef0173 100644 --- a/tests/UnitTestCase.php +++ b/tests/UnitTestCase.php @@ -1,5 +1,10 @@