- Getting started
- Basics
- Finding
- Relation Mapping
- Models
- Database
- BeanCan
- Advanced
- Architecture
- Other
Copy Beans
R::dup() makes a deep copy of a bean properly and without storing the bean. All own-beans will be copied as well. And all shared beans will be shared with the bean. The bean will not be stored so you have the chance to modify it before saving. Usage:
//entire bean hierarchy
$book->sharedReader[] = $reader;
$book->ownPage[] =$page;
$duplicated = R::dup($book);
//..change something...
$book->name = 'copy!';
//..then store...
R::store($duplicated);
Tweet
User contributed notes. Please use the comment section to provide tips, notes and examples. To ask for support or to provide feedback use the forum. For bug reports use Github Issue Tracker.
Site comments powered by Disquspage generated in 0.010668992996216 sec.