/** * Sorting items based on the priority attribute * * @param eZPageBlockItem $a * @param eZPageBlockItem $b * @return integer */ public function sortItemsByPriority( eZPageBlockItem $a, eZPageBlockItem $b ) { if ( $a->attribute('priority') > $b->attribute('priority') ) { return -1; } else if ( $a->attribute('priority') < $b->attribute('priority') ) { return 1; } else { return 0; } }