Browse Source

Implementing relationships

Michael Francis 14 năm trước cách đây
mục cha
commit
eaa0bfb689
1 tập tin đã thay đổi với 1 bổ sung2 xóa
  1. 1 2
      models/Post.php

+ 1 - 2
models/Post.php

@@ -4,9 +4,8 @@ namespace app\models;
 use app\models\User;
 
 class Post extends \lithium\data\Model {
-	protected $_meta = array('key' => '_id');
 
-//Overrides save so we can do some stuff before the data is commited to the database. 
+ public $belongsTo = array('User');
 
 /* Post model $_Schema:
  * _id => MongoID