Changeset 3921
- Timestamp:
- 03/02/08 04:14:06 (16 months ago)
- Location:
- branches/0.10/manual/docs/en
- Files:
-
- 5 modified
-
component-overview.txt (modified) (2 diffs)
-
getting-started/installation.txt (modified) (2 diffs)
-
mapping-relations.txt (modified) (1 diff)
-
migration.txt (modified) (1 diff)
-
schema-files.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/0.10/manual/docs/en/component-overview.txt
r3400 r3921 5 5 The classes that inherit {{Doctrine_Record}} are called components. There should be atleast one component for each database table. 6 6 7 There are couple of ways for creating new records. Propably the easiest is using native php new -operator. The other ways are calling {{Doctrine_Table::create()}} or {{Doctrine_Connection::create()}}. The last two exists only for backward compatibility. The recommended way of creating new objects is the new operator. 8 9 <code type="php"> 10 $user = $conn->create("User"); 11 12 // alternative way: 13 14 $table = $conn->getTable("User"); 15 16 $user = $table->create(); 17 18 // the simpliest way: 19 7 You can instantiate and use your models like the following below. 8 9 <code type="php"> 20 10 $user = new User(); 21 11 … … 35 25 36 26 <code type="php"> 27 $table = Doctrine::getTable('User'); 28 37 29 $user = $table->find(3); 38 30 -
branches/0.10/manual/docs/en/getting-started/installation.txt
r3837 r3921 61 61 62 62 <code type="bash"> 63 pear install http://pear.phpdoctrine.org/Doctrine-0.10. 163 pear install http://pear.phpdoctrine.org/Doctrine-0.10.2 64 64 </code> 65 65 … … 74 74 <code type="bash"> 75 75 tar xzf Doctrine-0.10.1.tgz 76 </code> 76 </code> 77 78 +++ Sandbox Package 79 80 Doctrine also provides a special package which is a zero configuration Doctrine implementation. It 81 includes a fully featured command line interface for managing your schema files, migrations, 82 database connections, data fixtures, and many other features. You can read about the sandbox package 83 and how to use it in the [doc utilities :name] chapter under the Sandbox section. 84 85 Below you will find the url to a tutorial on how to how to get started using 86 Doctrine with the sandbox package. With the sandbox and this tutorial you can get Doctrine up 87 and running in under 5 minutes. The tutorial offers example schema files, data fixtures, and a simple 88 script for managing a "User" model with Doctrine. Simple create, update, delete functionality. 89 90 The tutorial can be found here http://trac.phpdoctrine.org/wiki/MyFirstProject and the sandbox package 91 can be downloaded from here http://www.phpdoctrine.org/download -
branches/0.10/manual/docs/en/mapping-relations.txt
r2296 r3921 47 47 +++ One-To-One 48 48 49 Binding One-To-One foreign key associations is done with {{Doctrine_Record:: ownsOne()}} and {{Doctrine_Record::hasOne()}} methods. In the following example user owns one email and has one address. So the relationship between user and email is one-to-one composite. The relationship between user and address is one-to-one aggregate.49 Binding One-To-One foreign key associations is done with {{Doctrine_Record::hasOne()}} methods. In the following example user owns one email and has one address. So the relationship between user and email is one-to-one composite. The relationship between user and address is one-to-one aggregate. 50 50 51 51 The {{Email}} component here is mapped to {{User}} component's column {{email_id}} hence their relation is called LOCALKEY relation. On the other hand the {{Address}} component is mapped to {{User}} by it's {{user_id}} column hence the relation between {{User}} and {{Address}} is called FOREIGNKEY relation. -
branches/0.10/manual/docs/en/migration.txt
r2809 r3921 1 The Doctrine Migration tools allow you to migrate databases and it issues alter table statements directly to your databases when you need to deploy database changes. 1 The Doctrine Migration tools allow you to migrate databases and it issues alter table statements 2 directly to your databases when you need to deploy database changes. 2 3 3 4 ++ Writing Migration Classes 4 5 5 Migration classes consist of a simple class that extends from Doctrine_Migration. You can define a public up() and down() method that is meant for doing and undoing changes to a database for that migration step. The class name is completely arbitrary, but the name of the file which contains the class must have a prefix containing the number it represents in the migration process. Example: XXX_representative_name.class.php 6 Migration classes consist of a simple class that extends from Doctrine_Migration. You can define 7 a public up() and down() method that is meant for doing and undoing changes to a database for that 8 migration step. The class name is completely arbitrary, but the name of the file which contains the 9 class must have a prefix containing the number it represents in the migration process. 10 Example: XXX_representative_name.class.php 6 11 7 12 <code type="php"> -
branches/0.10/manual/docs/en/schema-files.txt
r3447 r3921 1 1 ++ Introduction 2 2 3 The purpose of schema files is to allow you to manage your model definitions directly from a yaml file rather then editing php code. The yaml schema file is parsed and used to generate all your model definitions/classes. This makes Doctrine model definitions much more portable. 4 5 Schema files support all the normal things you would write with manual php code. Component to connection binding, relationships, attributes, templates/behaviors, indexes, etc. 3 The purpose of schema files is to allow you to manage your model definitions directly from a yaml 4 file rather then editing php code. The yaml schema file is parsed and used to generate all your 5 model definitions/classes. This makes Doctrine model definitions much more portable. 6 7 Schema files support all the normal things you would write with manual php code. Component to 8 connection binding, relationships, attributes, templates/behaviors, indexes, etc. 6 9 7 10 ++ Relationships 8 11 9 When specifying relationships it is only necessary to specify the relationship on the end where the foreign key exists, although both ways are supported. 12 When specifying relationships it is only necessary to specify the relationship on the end where 13 the foreign key exists, although both ways are supported. 10 14 11 15 +++ One to One … … 244 248 ++ Indexes 245 249 246 Please see chapter [doc basic-schema-mapping :index :name] for more information about indexes and their options. 250 Please see chapter [doc basic-schema-mapping :index :name] for more information about indexes and 251 their options. 247 252 248 253 schema.yml … … 273 278 </code> 274 279 275 This is the PHP line of code that is auto-generated inside setTableDefinition() inside your base model class. 280 This is the PHP line of code that is auto-generated inside setTableDefinition() inside your base 281 model class. 276 282 277 283 <code type="php">