Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function create()
- {
- $this->autoRender = false;
- $thread = $this->Threads->newEntity($this->request->data['users'], ['associated' => ['Users']]);
- $this->Threads->save($thread);
- $users = $this->Threads->Users->find()->where(['Users.id IN' => $this->request->data['users']]);
- $this->Threads->Users->link($thread, $users->toArray());
- echo json_encode($thread->id, JSON_NUMERIC_CHECK);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement