Run the find on the join model. But, first, you should use the Cake
default naming. The model should be ProjectUser and the table
projects_users.
Put this in your Project model:
public function getAvailableProjects($user_id)
{
return $this->ProjectUser->find(
'all',
Thanks for the answer...
but, is the NOT IN the best way to do this?
I mean... cake doesnt have an own way to retrieve all no releated data?
Other question:
This way, cake will take the array and compare with each record on my db?
Cause it may take too long to exectue, since the system will have
There is a reference to "NOT IN" in the guide - I am sure you could adapt that?
http://book.cakephp.org/view/1030/Complex-Find-Conditions
Jeremy Burns
jeremybu...@me.com
On 6 Apr 2010, at 17:13, Renato de Freitas Freire wrote:
> Hi all.
> Sorry if its a noob question, but I cant find it anywher
Hi all.
Sorry if its a noob question, but I cant find it anywhere...
So...
I have this two tables:
Users:
id - int
username - varchar
password - varchar
created - datetime
Projects:
id - int
name - varchar
created - datetime
and this HABTM table:
User_Projects:
id - int
user_id - int
project_i