not sure, if you need to create a query-object:
private function getArtworkCount($gallery_id) {
$c = $this->modx->newQuery('artworks');
$c->where(array('gallery_id' => $gallery_id));
$count = $this->modx->getCount('artworks',$c);
$this->modx->log(modX::LOG_LEVEL_DEBUG, 'The current value of count:' . $count); // count is zero if this criteria is specified
return $count;
}
Yes Bruno! That did work. I see what I was doing wrongly: I wasn't thinking at row level.
Thanks once again
It seems that I didn't need the new query, it works without.