Changeset 3921

Show
Ignore:
Timestamp:
03/02/08 04:14:06 (16 months ago)
Author:
jwage
Message:

A little work to the manual.

Location:
branches/0.10/manual/docs/en
Files:
5 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/manual/docs/en/component-overview.txt

    r3400 r3921  
    55The classes that inherit {{Doctrine_Record}} are called components. There should be atleast one component for each database table. 
    66 
    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  
     7You can instantiate and use your models like the following below. 
     8 
     9<code type="php"> 
    2010$user = new User(); 
    2111 
     
    3525 
    3626<code type="php"> 
     27$table = Doctrine::getTable('User'); 
     28 
    3729$user = $table->find(3); 
    3830 
  • branches/0.10/manual/docs/en/getting-started/installation.txt

    r3837 r3921  
    6161 
    6262<code type="bash">  
    63 pear install http://pear.phpdoctrine.org/Doctrine-0.10.1 
     63pear install http://pear.phpdoctrine.org/Doctrine-0.10.2 
    6464</code> 
    6565 
     
    7474<code type="bash">  
    7575tar xzf Doctrine-0.10.1.tgz 
    76 </code>  
     76</code> 
     77 
     78+++ Sandbox Package 
     79 
     80Doctrine also provides a special package which is a zero configuration Doctrine implementation. It  
     81includes a fully featured command line interface for managing your schema files, migrations,  
     82database connections, data fixtures, and many other features. You can read about the sandbox package  
     83and how to use it in the [doc utilities :name] chapter under the Sandbox section. 
     84 
     85Below you will find the url to a tutorial on how to how to get started using  
     86Doctrine with the sandbox package. With the sandbox and this tutorial you can get Doctrine up  
     87and running in under 5 minutes. The tutorial offers example schema files, data fixtures, and a simple  
     88script for managing a "User" model with Doctrine. Simple create, update, delete functionality. 
     89 
     90The tutorial can be found here http://trac.phpdoctrine.org/wiki/MyFirstProject and the sandbox package  
     91can be downloaded from here http://www.phpdoctrine.org/download 
  • branches/0.10/manual/docs/en/mapping-relations.txt

    r2296 r3921  
    4747+++ One-To-One 
    4848 
    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. 
     49Binding 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. 
    5050 
    5151The {{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. 
     1The Doctrine Migration tools allow you to migrate databases and it issues alter table statements  
     2directly to your databases when you need to deploy database changes. 
    23 
    34++ Writing Migration Classes 
    45 
    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 
     6Migration classes consist of a simple class that extends from Doctrine_Migration. You can define  
     7a public up() and down() method that is meant for doing and undoing changes to a database for that  
     8migration step. The class name is completely arbitrary, but the name of the file which contains the  
     9class must have a prefix containing the number it represents in the migration process.  
     10Example: XXX_representative_name.class.php 
    611 
    712<code type="php"> 
  • branches/0.10/manual/docs/en/schema-files.txt

    r3447 r3921  
    11++ Introduction 
    22 
    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. 
     3The purpose of schema files is to allow you to manage your model definitions directly from a yaml  
     4file rather then editing php code. The yaml schema file is parsed and used to generate all your  
     5model definitions/classes. This makes Doctrine model definitions much more portable. 
     6 
     7Schema files support all the normal things you would write with manual php code. Component to  
     8connection binding, relationships, attributes, templates/behaviors, indexes, etc. 
    69 
    710++ Relationships 
    811 
    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. 
     12When specifying relationships it is only necessary to specify the relationship on the end where  
     13the foreign key exists, although both ways are supported. 
    1014 
    1115+++ One to One 
     
    244248++ Indexes 
    245249 
    246 Please see chapter [doc basic-schema-mapping :index :name] for more information about indexes and their options. 
     250Please see chapter [doc basic-schema-mapping :index :name] for more information about indexes and  
     251their options. 
    247252 
    248253schema.yml 
     
    273278</code> 
    274279 
    275 This is the PHP line of code that is auto-generated inside setTableDefinition() inside your base model class. 
     280This is the PHP line of code that is auto-generated inside setTableDefinition() inside your base  
     281model class. 
    276282 
    277283<code type="php">