Commit aeb1059f authored by pookey's avatar pookey

updating synchronizeFromArray to be synchronizeWithArray (thanks jwitten)

parent 0b78afa9
...@@ -161,7 +161,7 @@ Doctrine does the proxy evaluation based on loaded field count. It does not eval ...@@ -161,7 +161,7 @@ Doctrine does the proxy evaluation based on loaded field count. It does not eval
++ Arrays and objects ++ Arrays and objects
Doctrine_Records and Doctrine_Collections provide methods to facilitate working with arrays: {{toArray()}}, {{fromArray()}} and {{synchronizeFromArray()}}. Doctrine_Records and Doctrine_Collections provide methods to facilitate working with arrays: {{toArray()}}, {{fromArray()}} and {{synchronizeWithArray()}}.
+++ toArray +++ toArray
...@@ -189,9 +189,9 @@ $user->fromArray($data); ...@@ -189,9 +189,9 @@ $user->fromArray($data);
$user->Emails->count(); // --> 2 $user->Emails->count(); // --> 2
</code> </code>
+++ synchronizeFromArray +++ synchronizeWithArray
{{synchronizeFromArray()}} allows you to... well, synchronize a record with an array. So if have an array representation of your model and modify a field, modify a relationship field or even delete or create a relationship, this changes will be applied to the record. {{synchronizeWithArray()}} allows you to... well, synchronize a record with an array. So if have an array representation of your model and modify a field, modify a relationship field or even delete or create a relationship, this changes will be applied to the record.
<code type="php"> <code type="php">
$user = Doctrine_Query::create() $user = Doctrine_Query::create()
...@@ -217,7 +217,7 @@ $user = Doctrine_Query::create() ...@@ -217,7 +217,7 @@ $user = Doctrine_Query::create()
// sanitize the form input an get the data // sanitize the form input an get the data
$user->synchronizeFromArray($arrayUser); $user->synchronizeWithArray($arrayUser);
$user->save(); // all changes get applied to the user object $user->save(); // all changes get applied to the user object
</code> </code>
......
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