public static function completePosting() { $pending_posts = array(Eventt::where('status', session_id())->get()); $last_record = array(); foreach ($pending_posts as $source) { foreach ($source as $r) { $r->status = ''; $creator = $r->creator ? 'creator' : 'organizer'; $r->{$creator} = Sentry::getUser()->id; $r->public = 'on'; $r->save(); $last_record = $r; } } return !empty($last_record) ? All::tableName($last_record) . "/{$last_record->id}" : ''; }