[eluser]Phil Sturgeon[/eluser]
I'll admit it, im a Rapyd n00b and having a spot of trouble.
Using models it would normally be fairly easy to do something like:
Code:
if($data['banned'] == 1) $data['banned_by'] = getUserId();
But of course, Rapyd in all its ingenious timesaving devices doesnt wanna let me do that. So it falls to you, the lovely CI community to let me know how the hell I do this.
I have so far tried something like:
Code:
function method(){
// ...
$edit = new DataEdit($data['pagetitle'], $this->user_table);
// ...
$edit->pre_process('update', 'set_ban');
// ...
}
function set_ban($object)
{
// Make sure bannedBy is set to 0
if($object->get('banned') == 0):
$object->set('bannedBy', 0);
endif;
if($object->get('banned') == 1):
$bannedBy = getUserProperty('id');
$object->set('bannedBy', $bannedBy);
endif;
return TRUE;
}
Of course that code wont work, as its looking at whats CURRENTLY in the database, and not the data being used in the current submission. I cant work with data AFTER the current submission, as on the next pageload it will show old data until the user refreshes. I need DURING...