Wow, I haven’t posted anything on my blog for a while. I guess I must be busy. A new baby will have that effect.
Anyway, I’m happy to release an update to my Copyable behavior, which I shared with everyone a few months ago.
Download the new version on the Github repository.
Along with some general bug fixes, this newest version has a couple of significant bug fixes:
There’s also a new setting, “ignore”, which allows you to specify, via dot (.) notation, contained models that should be ignored.
For example, if a contain array for your model looks like this:
$contain = array(
'Page' => array('Image'),
'Log',
'User' => array('Group' => array('Permission'))
);
You can exclude the “Permission” contain by specifying the ignore setting:
public $actsAs = array('Copyable' => array('ignore' => array('User.Group.Permission')));
Handy for excluding certain assocations that don’t need to be copied, like changelogs and that sort of thing.
Enjoy, and, as always, comments and suggestions welcome!
