1
0
mirror of synced 2025-03-19 22:43:58 +03:00

Doctrine_Collection docs updated

This commit is contained in:
zYne 2006-08-22 18:36:34 +00:00
parent 69fff9cdce
commit 80dad424a2
6 changed files with 19 additions and 0 deletions

View File

@ -0,0 +1,6 @@
When accessing single elements of the collection and those elements (records) don't exist Doctrine auto-adds them.
<br \><br \>
In the following example
we fetch all users from database (there are 5) and then add couple of users in the collection.
<br \><br \>
As with PHP arrays the indexes start from zero.

View File

@ -7,3 +7,7 @@ of users doctrine only performs two queries for this whole transaction. The quer
<br \><br \>
DELETE FROM user WHERE id IN (1,2,3, ... ,N)<br \>
DELETE FROM phonenumber WHERE id IN (1,2,3, ... ,M)<br \>
<br \><br \>
It should also be noted that Doctrine is smart enough to perform single-shot-delete per table when transactions are used.
So if you are deleting a lot of records and want to optimize the operation just wrap the delete calls in Doctrine_Connection transaction.

View File

@ -0,0 +1 @@
The Doctrine_Collection method count returns the number of elements currently in the collection.

View File

@ -0,0 +1,7 @@
Doctrine_Collection is a collection of records (see Doctrine_Record). As with records the collections can be deleted and saved using
Doctrine_Collection::delete() and Doctrine_Collection::save() accordingly.
<br \><br \>
When fetching data from database with either DQL API (see Doctrine_Query) or rawSql API (see Doctrine_RawSql) the methods return an instance of
Doctrine_Collection by default.
<br \><br \>
The following example shows how to initialize a new collection:

View File

@ -0,0 +1 @@
As with records the collection can be saved by calling the save method.