1
0
mirror of synced 2025-01-29 19:41:45 +03:00

Docs updated

This commit is contained in:
doctrine 2006-08-08 09:07:55 +00:00
parent eb0eb44dbd
commit bc3c8c2eb8
7 changed files with 42 additions and 1 deletions

View File

@ -381,6 +381,8 @@ final class Doctrine {
$fp = fopen(self::$path.DIRECTORY_SEPARATOR.'Doctrine.compiled.php', 'w+');
fwrite($fp, "<?php
".implode('', $ret)."
class InvalidKeyException extends Exception { }
class DQLException extends Exception { }
?>");
fclose($fp);
}

View File

@ -0,0 +1,13 @@
<?php
$query = new Doctrine_RawSql($session);
$query->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();
?>

View File

@ -0,0 +1,7 @@
<?php
class User extends Doctrine_Record {
public function setTableDefinition() {
$this->hasColumn("uid","integer",20,"primary|autoincrement");
}
}
?>

View File

@ -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.

View File

@ -1,6 +1,10 @@
<?php
class Doctrine_AccessTestCase extends Doctrine_UnitTestCase {
public function prepareData() { }
public function prepareTables() {
$this->tables = array("Entity", "User");
parent::prepareTables();
}
public function testOffsetMethods() {
$user = new User();
$this->assertEqual($user["name"],null);

View File

@ -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");

View File

@ -1,5 +1,10 @@
<?php
require_once("../Doctrine.compiled.php");
require_once("../Doctrine.php");
Doctrine::compile();
//require_once("../Doctrine.compiled.php");
//Doctrine::loadAll();
function __autoload($class) {