Hi,
I have created an inner join criteria to show a list of elements in
the backend.
This are my models:
user:
name: { type: varchar(255) }
age: { type: integer }
article:
title: { type: varchar(255) }
content: { type: varchar(255) }
user_id: { type: varchar(255) }
and this is my generator.yml (a part) of the article module:
list:
peer_method: getArticles
display: [title, content, age]
And this is the method getArticles():
public static function getArticles()
{
$con = Propel::getConnection();
$sql = "select * from article LEFT JOIN user ON
article.user_id = user.id";
$stmt = $con->prepare($sql);
$result = $stmt->execute();
$articles = self::populateObjects($stmt);
return $articles;
}
As you can see I want to show the column corresponding to the "age"
field, so when I try to show the list of articles an error that says
something like "The method Articles::getAge() is not defined".
So I think I should create the method Articles::getAge(), but.. what
should i write inside? A new criteria that retrieves the user object
corresponding to the value of the field user_id of the article? Or
maybe am i wrong with any other stuff?
sf 1.4/propel
Regards
Javi
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en