public function sortItems( eZPageBlockItem $a, eZPageBlockItem $b )
    {
        if ( $a->attribute('priority') == $b->attribute('priority') )
        {
            if ( $a->attribute('ts_publication') > $b->attribute('ts_publication') )
            {
                return 1;
            }
            else if ( $a->attribute('ts_publication') < $b->attribute('ts_publication') )
            {
                return -1;
            }
            else
            {
                return 0;
            }
        }
        else if ( $a->attribute('priority') > $b->attribute('priority') )
        {
            return -1;
        }
        else if ( $a->attribute('priority') < $b->attribute('priority') )
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }
public function sortItems( eZPageBlockItem $a, eZPageBlockItem $b )
    {
        if ( $a->attribute('priority') == $b->attribute('priority') )
        {
            if ( $a->attribute('ts_publication') > $b->attribute('ts_publication') )
            {
                return 1;
            }
            else if ( $a->attribute('ts_publication') < $b->attribute('ts_publication') )
            {
                return -1;
            }
            else
            {
                return 0;
            }
        }
        else if ( $a->attribute('priority') > $b->attribute('priority') )
        {
            return -1;
        }
        else if ( $a->attribute('priority') < $b->attribute('priority') )
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }
public function sortItems ( eZPageBlockItem $ a , eZPageBlockItem $ b ) { if ( $ a -> attribute ( 'priority' ) == $ b -> attribute ( 'priority' ) ) { if ( $ a -> attribute ( 'ts_publication' ) > $ b -> attribute ( 'ts_publication' ) ) { return 1 ; } else if ( $ a -> attribute ( 'ts_publication' ) < $ b -> attribute ( 'ts_publication' ) ) { return - 1 ; } else { return 0 ; } } else if ( $ a -> attribute ( 'priority' ) > $ b -> attribute ( 'priority' ) ) { return - 1 ; } else if ( $ a -> attribute ( 'priority' ) < $ b -> attribute ( 'priority' ) ) { return 1 ; } else { return 0 ; } }
Sorting items based on the ts_publication and priority attributes

@param eZPageBlockItem $a
@param eZPageBlockItem $b
@return integer
Sorting items based on the ts_publication and priority attributes