Created
August 24, 2012 11:12
-
-
Save haruta/3449248 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function copy_row($fromid, $overwride = array()) { | |
$fom = $this->db->getTable('table')->find($fromid); | |
$to = $this->db->getTable('table')->create(); | |
$to->fromArray(array_merge($overwride, $from->toArray())); | |
$to->save(); | |
} | |
$new_row = copy_row(1, array('id' => null)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment