Hi,
I have a Model "Media" which hasmany "Files".
I wan to to fetch all records with files that are public.
So in my mediacontroller I call:
$conditions = array("File.public" => "1");
$this->recursive = 5;
$this->set('data', $this->Medium->findAll($conditions));
But I get the error:
SQL Error in model Medium: 1109: Unknown table 'File' in where clause
Is this not possible or Do I have a bug in my code ?
Thanx for any help.
Andy.
Cake-Version: 2708 2006-05-02 18:28:56Z
PHP Version 5.0.4
MySQL: 4.1.12a
models\medium.php
VALID_NOT_EMPTY,
);
var $hasMany = array('File' =>
array('className' => 'File',
'conditions' => '',
'order' => '',
'limit' => '',
'foreignKey' => 'media_id',
'dependent' => true,
'exclusive' => false,
'finderSql' => ''
)
);
}
?>
models\file.php
controllers\media_controller.php
"1");
$this->recursive = 5;
$this->set('data', $this->Medium->findAll($conditions));
}
...
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~--~~~~--~~--~--~---