thats findBySql in Akelos.
most functions are camelCased
Thank. found the function but I don't get the expected results
if my controller I have :
function myTest()
{
$this->topics =& $this->Topic->findBySql("SELECT T.id, T.title, count(*) as feeds_number FROM topics AS T INNER JOIN feeds as F ON T.id = F.topic_id GROUP BY id, title");
}
then in the view
{loop topics}
Title: {topic.title} n topics : {topic.feeds_number}
{end}
the point is that topics do not have feeds_number property.
I had a fast look at findBySql and it seems that getOnlyAvailableAttributes returns the table attibutes and not those in the SQL.
Am I wrong or is this a bug ?
-- Simone
You're right.
Ok, that's already something.
I'm trying to fix this.
Actually I taught that was enough to replace
$objects[] =& $this->instantiate($this->getOnlyAvailableAttributes($record), false);
with
$objects[] =& $this->instantiate($record, false);
But it doesn't work.
In the AkActiveRecord constructor I get the correct parameters, but the object is still created just with those of the table.
Hints ?
-- Simone
->setAttributes filters unknown attributes. (not columns nor so called combined attributes)
Can you be more specific? I don't get your question.
1 to 9 of 9