Commit 13840516 authored by legenerationlazi's avatar legenerationlazi

removed empty php tags at the top of some pages

html->wiki conversion previously missed
parent bdf8ce20
<?php ?>
Doctrine_Db_Profiler is an eventlistener for Doctrine_Db. It provides flexible query profiling. Besides the sql strings Doctrine_Db_Profiler is an eventlistener for Doctrine_Db. It provides flexible query profiling. Besides the sql strings
the query profiles include elapsed time to run the queries. This allows inspection of the queries that have been performed without the the query profiles include elapsed time to run the queries. This allows inspection of the queries that have been performed without the
need for adding extra debugging code to model classes. need for adding extra debugging code to model classes.
......
<?php ?>
Doctrine_Cache offers an intuitive and easy-to-use query caching solution. It provides the following things: Doctrine_Cache offers an intuitive and easy-to-use query caching solution. It provides the following things:
* Multiple cache backends to choose from (including Memcached, APC and Sqlite) * Multiple cache backends to choose from (including Memcached, APC and Sqlite)
......
<?php ?>
* Control statements based on the if and elseif constructs must have a single space before the opening parenthesis of the conditional, and a single space after the closing parenthesis. * Control statements based on the if and elseif constructs must have a single space before the opening parenthesis of the conditional, and a single space after the closing parenthesis.
......
<?php ?>
* Methods must be named by following the naming conventions. * Methods must be named by following the naming conventions.
......
PHP code must always be delimited by the full-form, standard PHP tags (<?php ?>) PHP code must always be delimited by the full-form, standard PHP tags ()
Short tags are never allowed. For files containing only PHP code, the closing tag must always be omitted Short tags are never allowed. For files containing only PHP code, the closing tag must always be omitted
......
<li>Function names may only contain alphanumeric characters. Underscores are not permitted. Numbers are permitted in function names but are discouraged. * Function names may only contain alphanumeric characters. Underscores are not permitted. Numbers are permitted in function names but are discouraged.
<li>Function names must always start with a lowercase letter. When a function name consists of more than one word, the first letter of each new word must be capitalized. This is commonly called the "studlyCaps" or "camelCaps" method. * Function names must always start with a lowercase letter. When a function name consists of more than one word, the first letter of each new word must be capitalized. This is commonly called the "studlyCaps" or "camelCaps" method.
<li>Verbosity is encouraged. Function names should be as verbose as is practical to enhance the understandability of code. * Verbosity is encouraged. Function names should be as verbose as is practical to enhance the understandability of code.
<li>For object-oriented programming, accessors for objects should always be prefixed with either "get" or "set". This applies to all classes except for Doctrine_Record which has some accessor methods prefixed with 'obtain' and 'assign'. The reason * For object-oriented programming, accessors for objects should always be prefixed with either "get" or "set". This applies to all classes except for Doctrine_Record which has some accessor methods prefixed with 'obtain' and 'assign'. The reason
for this is that since all user defined ActiveRecords inherit Doctrine_Record, it should populate the get / set namespace as little as possible. for this is that since all user defined ActiveRecords inherit Doctrine_Record, it should populate the get / set namespace as little as possible.
<li>Functions in the global scope ("floating functions") are NOT permmitted. All static functions should be wrapped in a static class. * Functions in the global scope ("floating functions") are NOT permmitted. All static functions should be wrapped in a static class.
...@@ -6,15 +6,15 @@ the lazy fetching strategy will be used whenever the records of 'example' table ...@@ -6,15 +6,15 @@ the lazy fetching strategy will be used whenever the records of 'example' table
<li> Global level * Global level
The attributes set in global level will affect every connection and every table in each connection. The attributes set in global level will affect every connection and every table in each connection.
<li> Connection level * Connection level
The attributes set in connection level will take effect on each table in that connection. The attributes set in connection level will take effect on each table in that connection.
<li> Table level * Table level
The attributes set in table level will take effect only on that table. The attributes set in table level will take effect only on that table.
......
<li> Doctrine::ATTR_LISTENER * Doctrine::ATTR_LISTENER
<li> Doctrine::ATTR_FETCHMODE = 2; * Doctrine::ATTR_FETCHMODE = 2;
<li> Doctrine::ATTR_CACHE_DIR = 3; * Doctrine::ATTR_CACHE_DIR = 3;
<li> Doctrine::ATTR_CACHE_TTL = 4; * Doctrine::ATTR_CACHE_TTL = 4;
<li> Doctrine::ATTR_CACHE_SIZE = 5; * Doctrine::ATTR_CACHE_SIZE = 5;
<li> Doctrine::ATTR_CACHE_SLAM = 6; * Doctrine::ATTR_CACHE_SLAM = 6;
<li> Doctrine::ATTR_CACHE = 7; * Doctrine::ATTR_CACHE = 7;
<li> Doctrine::ATTR_BATCH_SIZE = 8; * Doctrine::ATTR_BATCH_SIZE = 8;
<li> Doctrine::ATTR_PK_COLUMNS = 9; * Doctrine::ATTR_PK_COLUMNS = 9;
/** /**
* primary key type attribute * primary key type attribute
*/ */
<li> Doctrine::ATTR_PK_TYPE = 10; * Doctrine::ATTR_PK_TYPE = 10;
/** /**
* locking attribute * locking attribute
*/ */
<li> Doctrine::ATTR_LOCKMODE = 11; * Doctrine::ATTR_LOCKMODE = 11;
/** /**
* validatate attribute * validatate attribute
*/ */
<li> Doctrine::ATTR_VLD = 12; * Doctrine::ATTR_VLD = 12;
/** /**
* name prefix attribute * name prefix attribute
*/ */
<li> Doctrine::ATTR_NAME_PREFIX = 13; * Doctrine::ATTR_NAME_PREFIX = 13;
/** /**
* create tables attribute * create tables attribute
*/ */
<li> Doctrine::ATTR_CREATE_TABLES = 14; * Doctrine::ATTR_CREATE_TABLES = 14;
/** /**
* collection key attribute * collection key attribute
*/ */
<li> Doctrine::ATTR_COLL_KEY = 15; * Doctrine::ATTR_COLL_KEY = 15;
/** /**
* collection limit attribute * collection limit attribute
*/ */
<li> Doctrine::ATTR_COLL_LIMIT = 16; * Doctrine::ATTR_COLL_LIMIT = 16;
<?php ?>
You can quote the db identifiers (table and field names) with quoteIdentifier(). The delimiting style depends on which database driver is being used. NOTE: just because you CAN use delimited identifiers, it doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve. Anyway, it may be necessary when you have a reserved word as a field name (in this case, we suggest you to change it, if you can). You can quote the db identifiers (table and field names) with quoteIdentifier(). The delimiting style depends on which database driver is being used. NOTE: just because you CAN use delimited identifiers, it doesn't mean you SHOULD use them. In general, they end up causing way more problems than they solve. Anyway, it may be necessary when you have a reserved word as a field name (in this case, we suggest you to change it, if you can).
Some of the internal Doctrine methods generate queries. Enabling the "quote_identifier" attribute of Doctrine you can tell Doctrine to quote the identifiers in these generated queries. For all user supplied queries this option is irrelevant. Some of the internal Doctrine methods generate queries. Enabling the "quote_identifier" attribute of Doctrine you can tell Doctrine to quote the identifiers in these generated queries. For all user supplied queries this option is irrelevant.
......
<?php ?>
Doctrine allows you to bind connections to components (= your ActiveRecord classes). This means everytime a component issues a query Doctrine allows you to bind connections to components (= your ActiveRecord classes). This means everytime a component issues a query
or data is being fetched from the table the component is pointing at Doctrine will use the bound connection. or data is being fetched from the table the component is pointing at Doctrine will use the bound connection.
......
<?php ?>
Lazy-connecting to database is handled via Doctrine_Db wrapper. When using Doctrine_Db instead of PDO / Doctrine_Adapter, lazy-connecting Lazy-connecting to database is handled via Doctrine_Db wrapper. When using Doctrine_Db instead of PDO / Doctrine_Adapter, lazy-connecting
to database is being performed (that means Doctrine will only connect to database when needed). to database is being performed (that means Doctrine will only connect to database when needed).
......
<?php ?>
From the start Doctrine has been designed to work with multiple connections. Unless separately specified Doctrine always uses the current connection From the start Doctrine has been designed to work with multiple connections. Unless separately specified Doctrine always uses the current connection
for executing the queries. The following example uses openConnection() second argument as an optional for executing the queries. The following example uses openConnection() second argument as an optional
connection alias. connection alias.
......
<?php ?>
Opening a new database connection in Doctrine is very easy. If you wish to use PDO (www.php.net/PDO) you can just initalize a new PDO object: Opening a new database connection in Doctrine is very easy. If you wish to use PDO (www.php.net/PDO) you can just initalize a new PDO object:
......
<?php ?>
Doctrine_Export drivers provide an easy database portable way of altering existing database tables. Doctrine_Export drivers provide an easy database portable way of altering existing database tables.
......
<li> GROUP BY and HAVING clauses can be used for dealing with aggregate functions * GROUP BY and HAVING clauses can be used for dealing with aggregate functions
<li> Following aggregate functions are availible on DQL: COUNT, MAX, MIN, AVG, SUM * Following aggregate functions are availible on DQL: COUNT, MAX, MIN, AVG, SUM
Selecting alphabetically first user by name. Selecting alphabetically first user by name.
...@@ -17,7 +17,7 @@ SELECT SUM(a.amount) FROM Account a ...@@ -17,7 +17,7 @@ SELECT SUM(a.amount) FROM Account a
<li> Using an aggregate function in a statement containing no GROUP BY clause, results in grouping on all rows. In the example above * Using an aggregate function in a statement containing no GROUP BY clause, results in grouping on all rows. In the example above
we fetch all users and the number of phonenumbers they have. we fetch all users and the number of phonenumbers they have.
<code> <code>
...@@ -26,7 +26,7 @@ SELECT u.*, COUNT(p.id) FROM User u, u.Phonenumber p GROUP BY u.id ...@@ -26,7 +26,7 @@ SELECT u.*, COUNT(p.id) FROM User u, u.Phonenumber p GROUP BY u.id
<li> The HAVING clause can be used for narrowing the results using aggregate values. In the following example we fetch * The HAVING clause can be used for narrowing the results using aggregate values. In the following example we fetch
all users which have atleast 2 phonenumbers all users which have atleast 2 phonenumbers
<code> <code>
SELECT u.* FROM User u, u.Phonenumber p HAVING COUNT(p.id) >= 2 SELECT u.* FROM User u, u.Phonenumber p HAVING COUNT(p.id) >= 2
......
<li> *
NOT, ! NOT, !
...@@ -40,8 +40,8 @@ NOT, ! ...@@ -40,8 +40,8 @@ NOT, !
expression evaluates the same way as expression evaluates the same way as
(!1)+1. (!1)+1.
</li>
<li> *
<a name="function_and"></a> <a name="function_and"></a>
...@@ -81,8 +81,8 @@ NOT, ! ...@@ -81,8 +81,8 @@ NOT, !
-&gt; 0 -&gt; 0
</pre> </pre>
</li>
<li> *
OR OR
...@@ -121,8 +121,8 @@ NOT, ! ...@@ -121,8 +121,8 @@ NOT, !
-&gt; 1 -&gt; 1
</pre> </pre>
</li>
<li> *
<a name="function_xor"></a> <a name="function_xor"></a>
...@@ -162,6 +162,6 @@ NOT, ! ...@@ -162,6 +162,6 @@ NOT, !
a XOR b is mathematically equal to a XOR b is mathematically equal to
(a AND (NOT b)) OR ((NOT a) and b). (a AND (NOT b)) OR ((NOT a) and b).
</li>
<?php ?>
Doctrine supports default values for all data types. When default value is attached to a record column this means two of things. Doctrine supports default values for all data types. When default value is attached to a record column this means two of things.
First this value is attached to every newly created Record. First this value is attached to every newly created Record.
......
...@@ -15,9 +15,9 @@ In a hierarchical data model, data is organized into a tree-like structure. The ...@@ -15,9 +15,9 @@ In a hierarchical data model, data is organized into a tree-like structure. The
There are three major approaches to managing tree structures in relational databases, these are: There are three major approaches to managing tree structures in relational databases, these are:
<li>the adjacency list model</li> * the adjacency list model
<li>the nested set model (otherwise known as the modified pre-order tree traversal algorithm)</li> * the nested set model (otherwise known as the modified pre-order tree traversal algorithm)
<li>materialized path model</li> * materialized path model
......
<?php ?>
You can add indexes by simple calling Doctrine_Record::index('indexName', $definition) where $definition is the You can add indexes by simple calling Doctrine_Record::index('indexName', $definition) where $definition is the
definition array. definition array.
......
<?php ?>
Doctrine offers many index options, some of them being db-specific. Here is a full list of availible options: Doctrine offers many index options, some of them being db-specific. Here is a full list of availible options:
<code> <code>
......
<?php ?>
Doctrine supports many special indexes. These include Mysql FULLTEXT and Pgsql GiST indexes. Doctrine supports many special indexes. These include Mysql FULLTEXT and Pgsql GiST indexes.
In the following example we define a Mysql FULLTEXT index for the field 'content'. In the following example we define a Mysql FULLTEXT index for the field 'content'.
......
<?php ?>
Doctrine supports sequences for generating record identifiers. Sequences are a way of offering unique IDs for data rows. If you do most of your work with e.g. MySQL, think of sequences as another way of doing AUTO_INCREMENT. Doctrine supports sequences for generating record identifiers. Sequences are a way of offering unique IDs for data rows. If you do most of your work with e.g. MySQL, think of sequences as another way of doing AUTO_INCREMENT.
......
Doctrine automatically creates table names from the record class names. For this reason, it is recommended to name your record classes using the following rules: Doctrine automatically creates table names from the record class names. For this reason, it is recommended to name your record classes using the following rules:
<li>Use CamelCase naming</li> * Use CamelCase naming
<li>Underscores are allowed</li> * Underscores are allowed
<li>The first letter must be capitalized</li> * The first letter must be capitalized
<li>The class name cannot be one of the following (these keywords are reserved in DQL API): * The class name cannot be one of the following (these keywords are reserved in DQL API):
SELECT, FROM, WHERE, UPDATE, DELETE, JOIN, OUTER, INNER, LEFT, GROUP, ORDER, BY, HAVING, SELECT, FROM, WHERE, UPDATE, DELETE, JOIN, OUTER, INNER, LEFT, GROUP, ORDER, BY, HAVING,
...@@ -20,7 +20,7 @@ Doctrine automatically creates table names from the record class names. For this ...@@ -20,7 +20,7 @@ Doctrine automatically creates table names from the record class names. For this
CHARACTER_LENGTH, CHAR_LENGTH, BIT_LENGTH, CURRENT_TIME, CURRENT_DATE, CHARACTER_LENGTH, CHAR_LENGTH, BIT_LENGTH, CURRENT_TIME, CURRENT_DATE,
CURRENT_TIMESTAMP, NEW, EXISTS, ALL, ANY, SOME. CURRENT_TIMESTAMP, NEW, EXISTS, ALL, ANY, SOME.
</li>
Example. My_PerfectClass Example. My_PerfectClass
......
<?php ?>
Doctrine offers various table options. All table options can be set via Doctrine_Record::option($optionName, $value) Doctrine offers various table options. All table options can be set via Doctrine_Record::option($optionName, $value)
......
...@@ -2,16 +2,16 @@ A database transaction is a unit of interaction with a database management syste ...@@ -2,16 +2,16 @@ A database transaction is a unit of interaction with a database management syste
and reliable way independent of other transactions that must be either entirely completed or aborted. and reliable way independent of other transactions that must be either entirely completed or aborted.
Ideally, a database system will guarantee all of the ACID(Atomicity, Consistency, Isolation, and Durability) properties for each transaction. Ideally, a database system will guarantee all of the ACID(Atomicity, Consistency, Isolation, and Durability) properties for each transaction.
<li>[http://en.wikipedia.org/wiki/Atomicity Atomicity] refers to the ability of the DBMS to guarantee that either all of the tasks of a transaction are performed or none of them are. The transfer of funds can be completed or it can fail for a multitude of reasons, but atomicity guarantees that one account won't be debited if the other is not credited as well.</li> * [http://en.wikipedia.org/wiki/Atomicity Atomicity] refers to the ability of the DBMS to guarantee that either all of the tasks of a transaction are performed or none of them are. The transfer of funds can be completed or it can fail for a multitude of reasons, but atomicity guarantees that one account won't be debited if the other is not credited as well.
<li>[http://en.wikipedia.org/wiki/Database_consistency Consistency] refers to the database being in a legal state when the transaction begins and when it ends. This means that a transaction can't break the rules, or //integrity constraints//, of the database. If an integrity constraint states that all accounts must have a positive balance, then any transaction violating this rule will be aborted.</li> * [http://en.wikipedia.org/wiki/Database_consistency Consistency] refers to the database being in a legal state when the transaction begins and when it ends. This means that a transaction can't break the rules, or //integrity constraints//, of the database. If an integrity constraint states that all accounts must have a positive balance, then any transaction violating this rule will be aborted.
<li>[http://en.wikipedia.org/wiki/Isolation_%28computer_science%29 Isolation] refers to the ability of the application to make operations in a transaction appear isolated from all other operations. This means that no operation outside the transaction can ever see the data in an intermediate state; a bank manager can see the transferred funds on one account or the other, but never on botheven if she ran her query while the transfer was still being processed. More formally, isolation means the transaction history (or [http://en.wikipedia.org/wiki/Schedule_%28computer_science%29 schedule]) is [http://en.wikipedia.org/wiki/Serializability serializable]. For performance reasons, this ability is the most often relaxed constraint. See the [/wiki/Isolation_%28computer_science%29 isolation] article for more details.</li> * [http://en.wikipedia.org/wiki/Isolation_%28computer_science%29 Isolation] refers to the ability of the application to make operations in a transaction appear isolated from all other operations. This means that no operation outside the transaction can ever see the data in an intermediate state; a bank manager can see the transferred funds on one account or the other, but never on botheven if she ran her query while the transfer was still being processed. More formally, isolation means the transaction history (or [http://en.wikipedia.org/wiki/Schedule_%28computer_science%29 schedule]) is [http://en.wikipedia.org/wiki/Serializability serializable]. For performance reasons, this ability is the most often relaxed constraint. See the [/wiki/Isolation_%28computer_science%29 isolation] article for more details.
<li>[http://en.wikipedia.org/wiki/Durability_%28computer_science%29 Durability] refers to the guarantee that once the user has been notified of success, the transaction will persist, and not be undone. This means it will survive system failure, and that the [http://en.wikipedia.org/wiki/Database_system database system] has checked the integrity constraints and won't need to abort the transaction. Typically, all transactions are written into a [http://en.wikipedia.org/wiki/Database_log log] that can be played back to recreate the system to its state right before the failure. A transaction can only be deemed committed after it is safely in the log.</li> * [http://en.wikipedia.org/wiki/Durability_%28computer_science%29 Durability] refers to the guarantee that once the user has been notified of success, the transaction will persist, and not be undone. This means it will survive system failure, and that the [http://en.wikipedia.org/wiki/Database_system database system] has checked the integrity constraints and won't need to abort the transaction. Typically, all transactions are written into a [http://en.wikipedia.org/wiki/Database_log log] that can be played back to recreate the system to its state right before the failure. A transaction can only be deemed committed after it is safely in the log.
- //from [http://www.wikipedia.org wikipedia]// - //from [http://www.wikipedia.org wikipedia]//
...@@ -20,10 +20,10 @@ Ideally, a database system will guarantee all of the ACID(Atomicity, Consistency ...@@ -20,10 +20,10 @@ Ideally, a database system will guarantee all of the ACID(Atomicity, Consistency
In Doctrine all operations are wrapped in transactions by default. There are some things that should be noticed about how Doctrine works internally: In Doctrine all operations are wrapped in transactions by default. There are some things that should be noticed about how Doctrine works internally:
<li> Doctrine uses application level transaction nesting. * Doctrine uses application level transaction nesting.
<li> Doctrine always executes INSERT / UPDATE / DELETE queries at the end of transaction (when the outermost commit is called). The operations * Doctrine always executes INSERT / UPDATE / DELETE queries at the end of transaction (when the outermost commit is called). The operations
are performed in the following order: all inserts, all updates and last all deletes. Doctrine knows how to optimize the deletes so that are performed in the following order: all inserts, all updates and last all deletes. Doctrine knows how to optimize the deletes so that
delete operations of the same component are gathered in one query. delete operations of the same component are gathered in one query.
......
<?php ?>
Doctrine supports transaction savepoints. This means you can set named transactions and have them nested. Doctrine supports transaction savepoints. This means you can set named transactions and have them nested.
......
...@@ -5,7 +5,7 @@ influental things when it comes to boosting application performance. ...@@ -5,7 +5,7 @@ influental things when it comes to boosting application performance.
<li>Immediate Collection * Immediate Collection
Fetches all records and all record data immediately into collection memory. Use this collection only if you really need to show all that data Fetches all records and all record data immediately into collection memory. Use this collection only if you really need to show all that data
in web page. in web page.
...@@ -17,7 +17,7 @@ SELECT id, name, type, created FROM user ...@@ -17,7 +17,7 @@ SELECT id, name, type, created FROM user
<li>Batch Collection * Batch Collection
Fetches all record primary keys into colletion memory. When individual collection elements are accessed this collection initializes proxy objects. Fetches all record primary keys into colletion memory. When individual collection elements are accessed this collection initializes proxy objects.
When the non-primary-key-property of a proxy object is accessed that object sends request to Batch collection which loads the data When the non-primary-key-property of a proxy object is accessed that object sends request to Batch collection which loads the data
for that specific proxy object as well as other objects close to that proxy object. for that specific proxy object as well as other objects close to that proxy object.
...@@ -35,7 +35,7 @@ SELECT id, name, type, created FROM user WHERE id IN (6,7,8,9,10) ...@@ -35,7 +35,7 @@ SELECT id, name, type, created FROM user WHERE id IN (6,7,8,9,10)
[ ... ] [ ... ]
<li>Lazy Collection * Lazy Collection
Lazy collection is exactly same as Batch collection with batch size preset to one. Lazy collection is exactly same as Batch collection with batch size preset to one.
...@@ -53,7 +53,7 @@ SELECT id, name, type, created FROM user WHERE id = 3 ...@@ -53,7 +53,7 @@ SELECT id, name, type, created FROM user WHERE id = 3
[ ... ] [ ... ]
<li>Offset Collection * Offset Collection
Offset collection is the same as immediate collection with the difference that it uses database provided limiting of queries. Offset collection is the same as immediate collection with the difference that it uses database provided limiting of queries.
......
<?php ?>
Doctrine_Db allows both PEAR-like DSN (data source name) as well as PDO like DSN as constructor parameters. Doctrine_Db allows both PEAR-like DSN (data source name) as well as PDO like DSN as constructor parameters.
......
<?php ?>
Doctrine_Db has a pluggable event listener architecture. It provides before and after Doctrine_Db has a pluggable event listener architecture. It provides before and after
listeners for all relevant methods. Every listener method takes one parameter: a Doctrine_Db_Event object, which listeners for all relevant methods. Every listener method takes one parameter: a Doctrine_Db_Event object, which
holds info about the occurred event. holds info about the occurred event.
......
<?php ?>
The FROM clause indicates the component or components from which to retrieve records. The FROM clause indicates the component or components from which to retrieve records.
If you name more than one component, you are performing a join. If you name more than one component, you are performing a join.
For each table specified, you can optionally specify an alias. Doctrine_Query offers easy to use For each table specified, you can optionally specify an alias. Doctrine_Query offers easy to use
......
<?php ?>
Doctrine_Query provides having() method for adding HAVING conditions to the DQL query. This method is identical in function to the Doctrine_Query::where() method. Doctrine_Query provides having() method for adding HAVING conditions to the DQL query. This method is identical in function to the Doctrine_Query::where() method.
......
<?php ?>
DQL (Doctrine Query Language) is a object query language which allows DQL (Doctrine Query Language) is a object query language which allows
you to find objects. DQL understands things like object relationships, polymorphism and you to find objects. DQL understands things like object relationships, polymorphism and
inheritance (including column aggregation inheritance). inheritance (including column aggregation inheritance).
......
<?php ?>
The WHERE clause, if given, indicates the condition or conditions that the records must satisfy to be selected. The WHERE clause, if given, indicates the condition or conditions that the records must satisfy to be selected.
Doctrine_Query provides easy to use WHERE -part management methods where and addWhere. The where methods always overrides Doctrine_Query provides easy to use WHERE -part management methods where and addWhere. The where methods always overrides
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment