Thx adam, working perfectly
Regards,
On May 3, 3:43 am, Adam Royle [EMAIL PROTECTED] wrote:
As long as you have var $belongsTo = array('Author'); in your Comment
model, just set recursive to a higher value.
$this-Post-recursive = 2;
$posts = $this-Post-findAll();
Cheers,
Adam
On May
Ok, i m trying cakephp for one of my application, till now no errors
are there cakephp is making life easy
but now i am stuck in one simple problem
I am having these tables in database
Post
-id (PK)
-title
-description
Comment
-id (PK)
-comment
-post_id (FK)
-author_id (FK)
Author
-id
As long as you have var $belongsTo = array('Author'); in your Comment
model, just set recursive to a higher value.
$this-Post-recursive = 2;
$posts = $this-Post-findAll();
Cheers,
Adam
On May 3, 3:40 am, deeps [EMAIL PROTECTED] wrote:
Ok, i m trying cakephp for one of my application, till now
hi,
i have problems using hasOne
basically i want to achieve: a project hasOne status
TABLES
projects
id
title
status_id
statuses
id
title
class Project extends AppModel
{
var $name='Project';
var $hasOne = array('Status' =
array('className' = 'Status',
'conditions' =
On May 23, 2007, at 3:21 PM, pete wrote:
hi,
i have problems using hasOne
basically i want to achieve: a project hasOne status
TABLES
projects
id
title
status_id
statuses
id
title
The way you have things keyed here, its actually
Status hasOne Project (and Project
hm..
i want to print out all projects and instead of the project.status_id,
i want to show the status.title
how could i do that?
thanks
pete
On May 23, 5:29 pm, John David Anderson (_psychic_)
[EMAIL PROTECTED] wrote:
On May 23, 2007, at 3:21 PM, pete wrote:
hi,
i have problems using
On May 23, 2007, at 4:21 PM, pete wrote:
hm..
i want to print out all projects and instead of the project.status_id,
i want to show the status.title
how could i do that?
If Project belongsTo Status:
$projects = $this-Project-findAll();
foreach($projects as $project)
{
echo
hm..
i want to print out all projects and instead of the project.status_id,
i want to show the status.title
provided you setup you models correctly, eg:
Project belongsTo Status
Status hasMany Project
// in your ProjectsController
$this-Project-recursive = 1;
$projects =