application/models/Timechoice_model.php
/**
     * Creates or modifies an SMR choice object.
     */
Creates or modifies an SMR choice object.
Creates or modifies an SMR choice object .
public function store($post) {        
        $now = date('Y-m-d h:i:s');
        $timechoice = ($post['timechoice_id']==0 ? R::dispense('timechoice') : R::load('timechoice', $post['timechoice_id']));
        $timechoice->time_choice = $post['time_choice'];
        if($post['timechoice_id']==0) {
            $timechoice->created = $now;
            $timechoice->created_by = $_SESSION['user_id'];
        } else {
            $timechoice->modified = $now;
            $timechoice->modified_by = $_SESSION['user_id'];
        }
        R::store($timechoice);
    }
public function store ( $ post ) { $ now = date ( 'Y-m-d h:i:s' ) ; $ timechoice = ( $ post [ 'timechoice_id' ] == 0 ? R :: dispense ( 'timechoice' ) : R :: load ( 'timechoice' , $ post [ 'timechoice_id' ] ) ) ; $ timechoice -> time_choice = $ post [ 'time_choice' ] ; if ( $ post [ 'timechoice_id' ] == 0 ) { $ timechoice -> created = $ now ; $ timechoice -> created_by = $ _SESSION [ 'user_id' ] ; } else { $ timechoice -> modified = $ now ; $ timechoice -> modified_by = $ _SESSION [ 'user_id' ] ; } R :: store ( $ timechoice ) ; }
Creates or modifies an SMR choice object.
Creates or modifies an SMR choice object .