saveAll() inserts new row instead of updating
问题 I'm trying to update a record with CakePHP SaveAll() method but however, it adds new row instead of updating it. My model are as follow: A Store hasOne Map class Store extends AppModel { var $name = 'Store'; var $hasOne = array( 'Map' => array( 'className' => 'Map', 'foreignKey' => 'store_id', 'dependent' => true, 'exclusive' => true ) ); } My edit form has a Store ID (hidden field) to tell CakePHP to update a particular record only. <?php echo $this->Form->input('Store.id'); ?> <?php echo