扩展ModuleAdminController添加/编辑不起作用

So this seems really dumb question maybe and basically a text book implementation. But when using the Add/Edit buttons created by the renderList() the submitted fields are empty. I have gone into the core ObjectModel class and output the results and indeed no data is passing back. From what I can tell this should all link up since all of this is generated/handled by the backend but obviously missing something.

class AdminStoreMatrixController extends ModuleAdminController {
protected $actions_available = array('edit', 'delete');//, 'details');
protected $actions = array('edit', 'delete');//, 'details');
protected $position_identifier = 'id_store_matrices';

public function __construct() {

    $this->context = Context::getContext();
    $this->table = 'store_matrices';
    $this->identifier = 'id_store_matrices';
    $this->className = 'StoreMatrix';
    $this->lang = false;

    $this->fields_list = array(
        'id_store_matrices' => array('title' => $this->l('#')),
        'price_low' => array('title' => $this->l('Price Low')),
        'price_high' => array('title' => $this->l('Price High')),
        'apr' => array('title' => $this->l('APR')),
        'apr_term' => array('title' => $this->l('APR Term')),
        'down_payment' => array('title' => $this->l('Down Payment')),
        'shipping' => array('title' => $this->l('Shipping')),
    );

    // This adds a multiple deletion button
    $this->bulk_actions = array(
        'delete' => array(
            'text' => $this->l('Delete selected'),
            'confirm' => $this->l('Delete selected items?')
        )
    );
    parent::__construct();
}


// This method generates the list of results
//public function renderList() {
//  $this->addRowAction('edit');
//  $this->addRowAction('delete');
    //$this->addRowAction('details');
//  return parent::renderList();
//}

// This method generates the Add/Edit form
public function renderForm() {
    // Building the Add/Edit form
    $this->fields_form = array(
        'legend' => array(
            'title' => $this->l('Store Matrices')
        ),
        'input' => array(
            array(
                'type' => 'text',
                'label' => $this->l('Price Low:'),
                'name' => 'price_low',
                'size' => 10,
                'required' => true,
                'desc' => $this->l('Lowest price this will apply too'),
            ),
            array(
                'type' => 'text',
                'label' => $this->l('Price High:'),
                'name' => 'price_high',
                'size' => 10,
                'required' => true,
                'desc' => $this->l('Highest price this will apply too'),
            ),
            array(
                'type' => 'text',
                'label' => $this->l('APR:'),
                'name' => 'apr',
                'size' => 5,
                'required' => true,
                'desc' => $this->l('Annual Percentage Rate'),
            ),
            array(
                'type' => 'text',
                'label' => $this->l('APR Term:'),
                'name' => 'apr_term',
                'size' => 33,
                'required' => true,
                'desc' => $this->l('Months the APR will apply'),
            ),
            array(
                'type' => 'text',
                'label' => $this->l('Down Payment:'),
                'name' => 'down_payment',
                'size' => 5,
                'required' => true,
                'desc' => $this->l('Percentage of Down payment'),
            ),
            array(
                'type' => 'text',
                'label' => $this->l('Shipping:'),
                'name' => 'shipping',
                'size' => 5,
                'required' => true,
                'desc' => $this->l('Percentage of Shipping cost'),
            ),
        ),
        'submit' => array(
            'title' => $this->l('   Save   '),
            'class' => 'button'
        )
    );
    return parent::renderForm();
}

The Model storematrix.php

class StoreMatrix extends ObjectModel {

 /* 
 *//**
 * @see ObjectModel::$definition
 */
public static $definition = array(
    'table' => 'store_matrices',
    'primary' => 'id_store_matrices',
    'fields' => array(
        'price_low' =>          array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
        'price_high' =>         array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
        'apr' =>                array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
        'apr_term' =>           array('type' => self::TYPE_INT,     'validate' => 'isInt',      'required' => true, 'size' => 10),
        'down_payment' =>       array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
        'shipping' =>           array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
    ),
);
}

So the issue with the model in prestashop is that you not only need to have the definitions for the fields but also you must actually declare the fields as public above. See the below and now everything work perfect.

class StoreMatrix extends ObjectModel {
    //fields to store into the database
    public $price_low;
    public $price_high;
    public $apr;
    public $apr_term;
    public $down_payment;
    public $shipping;

     /* 
     *//**
     * @see ObjectModel::$definition
     */
    public static $definition = array(
        'table' => 'store_matrices',
        'primary' => 'id_store_matrices',
        'fields' => array(
            'price_low' =>          array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
            'price_high' =>         array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
            'apr' =>                array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
            'apr_term' =>           array('type' => self::TYPE_INT,     'validate' => 'isInt',      'required' => true, 'size' => 10),
            'down_payment' =>       array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
            'shipping' =>           array('type' => self::TYPE_FLOAT,   'validate' => 'isFloat',    'required' => true, 'size' => 10),
        ),
    );
}