Skip to content
Browse files

set primaryKey in Model files of sample

  • Loading branch information...
1 parent dab3e1a commit bf68bdcdbafc40c3123e662b72af32aab006abd9 @ichikaway committed Aug 24, 2011
View
1 samples/Controller/PostsController.php
@@ -68,7 +68,6 @@ public function edit($id = null) {
$this->flash(__('Invalid Post', true), array('action' => 'index'));
}
if (!empty($this->data)) {
- $this->Post->id = $id;
if ($this->Post->save($this->data)) {
$this->flash(__('The Post has been saved.', true), array('action' => 'index'));
} else {
View
1 samples/Controller/SubdocumentsController.php
@@ -60,7 +60,6 @@ public function edit($id = null) {
$this->flash(__('Invalid Subdocument', true), array('action' => 'index'));
}
if (!empty($this->data)) {
- $this->Subdocument->id = $id;
if ($this->Subdocument->save($this->data)) {
$this->flash(__('The Subdocument has been saved.', true), array('action' => 'index'));
} else {
View
1 samples/Model/Post.php
@@ -1,6 +1,7 @@
<?php
class Post extends AppModel {
+ public $primaryKey = '_id';
//var $useDbConfig = 'mongo';
/*
var $mongoSchema = array(
View
1 samples/Model/Subdocument.php
@@ -1,5 +1,6 @@
<?php
class Subdocument extends AppModel {
+ public $primaryKey = '_id';
/*
var $mongoSchema = array(
'title' => array('type'=>'string'),

0 comments on commit bf68bdc

Please sign in to comment.
Something went wrong with that request. Please try again.