Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $this->set("post", $this->Post->find("first", array("conditions" => array("Post.id" => $id), "contain" => array("User", "Project", "Project.Post" => array("id", "image", "title"), "Comment", "Comment.User" => array("id", "username", "mail"), "Comment.User.Post" => array("id", "image", "title")))));
- $this->set("neighbors", $this->Post->find("neighbors", array("field" => "id", "value" => $id)));
- $post = $this->Post->find("first", ...); // this is your first find call, assign it to a var instead
- $neighbors = $this->Post->find('neighbors', array(
- 'field' => 'id',
- 'value' => $id,
- 'conditions' => array(
- 'Post.project_id' => $post['Post']['project_id'],
- ),
- ));
- $this->set(compact('post', 'neighbors'));
Add Comment
Please, Sign In to add comment