Get Clone
Get Clone returns a clone of the object.
Note: PHP's clone function is only capable of performing a shallow clone of objects. DataMapper's clone process has been improved over the default to be slightly less shallow, so related objects of a clone are also clones rather than references.
// Get a user $u = new User(); $u->get_by_id($id); $clone = $u->get_clone();
Looking at the above, both the $clone and $u objects are identical except you can modify the data of one, without affecting the data stored in the other. Saving the objects will of course update the same record in the database.
Get Copy
Get Copy returns a copy of the object. This is essentially a clone of the object but with the ID cleared. It can allow you to quickly save a new record of an existing similar item. For example:
// Let's save a new hosting plan $p = new Plan(); $p->name = 'The 100GB Plan'; $p->storage = 1000; $p->bandwidth = 2000; $p->databases = 5; $p->domains = 5; $p->emails = 50; $p->save(); // Now, lets make a copy of that saved plan and base a new one off of it $p = $p->get_copy(); // Change only what we need to $p->name = 'The Big 150GB Plan'; $p->storage = 1500; $p->bandwidth = 2500; // And now save a new record $p->save();