med wrote:
> As you see from comments, I cannot use $object->listparameters() on the
> Object returned by QueryBuilder.
> I just dont have a clue why this fails.
> Can anyone comment on this? Is this maybe a known midgard-1.8.0 problem?
I suggest you to use midcom_db objects as they are much more rich due to
an extra abstraction layer.
So, instead you could do this under MidCOM:
<?php
// Get the query builder
$qb = midcom_db_article::new_query_builder();
// Or (I reckon)
// $qb = new midgard_query_builder('midgard_article')
$qb->add_constraint('topic', '=', (int) $a_topic_id);
$results = $qb->execute();
foreach ($results as $article)
{
$parameters = $article->list_parameters();
print_r($parameters);
/** Or do this to get all the parameters of e.g. domain
* 'midcom.helper.datamanager2'
*/
$p = $article->list_parameters('midcom.helper.datamanager2');
print_r($p);
}
?>
> $params = $all_questions->listparameters();
> //^^^^ line above fails with "Call to a member function on a
> non-object"
>
> if($params->N > 0)
> {
> while($params->fetch())
> {
> echo $params->domain;
> }
> }
> }
`$params = $object->listparameters()` spiced with `$params->fetch()`
might be already long since deprecated and it's so Midgard 1.7.
--
Arttu
_______________________________________________
user mailing list
[email protected]
http://lists.midgard-project.org/mailman/listinfo/user