| 121 | | |
| 122 | | $conditions = array("News.user_id" => $this->Auth->user('id') ); // only the user's news |
| 123 | | $fields = array("id", "title", "body", "created", "reference", "status", "theme_id", "user_id"); |
| 124 | | $order = "News.id DESC"; |
| 125 | | $limit = 20; |
| 126 | | |
| 127 | | $this->set('data', $this->News->findAll($conditions, $fields, $order, $limit)); |
| | 121 | $this->News->unbindModel(array('hasMany'=>array('Discussion'))); |
| | 122 | $this->paginate['conditions'] = null; |
| | 123 | $this->paginate['fields'] = array('News.id', 'News.title', 'News.created', 'News.status', 'News.user_id', 'User.username'); |
| | 124 | $this->paginate['order'] = 'News.id DESC'; |
| | 125 | $this->paginate['limit'] = 20; |
| | 126 | $data = $this->paginate('News'); |
| | 127 | |
| | 128 | $this->set(compact('data')); |