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