package-product/Models/Product.php
/**
     *
     * @param ARRAY $params list of parameters
     * @param INT $id is primary key
     * @return type
     */
@param ARRAY $params list of parameters
@param INT $id is primary key
@return type
@param ARRAY $params list of parameters @param INT $id is primary key @return type
public function updateItem($params = [], $id = NULL) {
        if (empty($id)) {
            $id = $params['id'];
        }
        $field_status = $this->field_status;
        $product = $this->selectItem($params);
        if (!empty($product)) {
            $dataFields = $this->getDataFields($params, $this->fields);
            foreach ($dataFields as $key => $value) {
                $product->$key = $value;
            }
            $product->$field_status = $this->status['publish'];
            $product->save();
            return $product;
        } else {
            return NULL;
        }
    }
public function updateItem ( $ params = [ ] , $ id = NULL ) { if ( empty ( $ id ) ) { $ id = $ params [ 'id' ] ; } $ field_status = $ this -> field_status ; $ product = $ this -> selectItem ( $ params ) ; if ( ! empty ( $ product ) ) { $ dataFields = $ this -> getDataFields ( $ params , $ this -> fields ) ; foreach ( $ dataFields as $ key => $ value ) { $ product -> $ key = $ value ; } $ product -> $ field_status = $ this -> status [ 'publish' ] ; $ product -> save ( ) ; return $ product ; } else { return NULL ; } }
@param ARRAY $params list of parameters
 @param INT $id is primary key
 @return type
@param ARRAY $params list of parameters @param INT $id is primary key @return type