exclude(Q::any(array(
'ispublic'=>Category::VISIBILITY_PRIVATE,
Q::all(array(
'faqs__ispublished'=>FAQ::VISIBILITY_PRIVATE,
'children__ispublic' => Category::VISIBILITY_PRIVATE,
'children__faqs__ispublished'=>FAQ::VISIBILITY_PRIVATE,
))
)))
//->annotate(array('faq_count'=>SqlAggregate::COUNT('faqs__ispublished')));
->annotate(array('faq_count' => SqlAggregate::COUNT(
SqlCase::N()
->when(array(
'faqs__ispublished__gt'=> FAQ::VISIBILITY_PRIVATE), 1)
->otherwise(null)
)))
->annotate(array('children_faq_count' => SqlAggregate::COUNT(
SqlCase::N()
->when(array(
'children__faqs__ispublished__gt'=> FAQ::VISIBILITY_PRIVATE), 1)
->otherwise(null)
)));
// ->filter(array('faq_count__gt' => 0));
if ($categories->exists(true)) { ?>
parent)
&& ($categories->findFirst(array(
'category_id' => $p->getId()))))
continue;
$count = $C->faq_count + $C->children_faq_count;
?>
-
%s %s',
$C->getId(), Format::htmlchars($C->getLocalName()),
$count ? "({$count})": ''
); ?>
getLocalDescriptionWithImages()); ?>
getPublicSubCategories())) {
echo '
';
foreach ($subs as $c) {
echo sprintf('
',
$c->getId(),
$c->getLocalName(),
$c->faq_count
);
}
echo '
';
}
foreach ($C->faqs
->exclude(array('ispublished'=>FAQ::VISIBILITY_PRIVATE))
->limit(5) as $F) { ?>