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