public function getWaitingBlockItems(Block $block)
{
$dbHandler = $this->getConnection();
$q = $dbHandler->createSelectQuery();
$q->select('object_id, node_id, priority, ts_publication, rotation_until, moved_to')->from($dbHandler->quoteTable('ezm_pool'))->where($q->expr->eq('block_id', $q->bindValue($block->id)), $q->expr->eq('ts_visible', $q->bindValue(0, null, PDO::PARAM_INT)), $q->expr->eq('ts_hidden', $q->bindValue(0, null, PDO::PARAM_INT)))->orderBy('ts_publication')->orderBy('priority');
$stmt = $q->prepare();
$stmt->execute();
$rows = $stmt->fetchAll(PDO::FETCH_ASSOC);
$items = array();
foreach ($rows as $row) {
$items[] = $this->buildBlockItem($row + array('block_id' => $block->id, 'ts_visible' => 0, 'ts_hidden' => 0));
}
return $items;
}