MatthiasMullie\Scrapbook\Buffered\Utils\Defer::sortUpdates PHP Метод

sortUpdates() защищенный Метод

Change the order of the updates in this transaction to ensure we have those most likely to fail first. That'll decrease odds of having to roll back, and make rolling back easier.
protected sortUpdates ( array $a, array $b ) : integer
$a array Update, where index 0 is the operation name
$b array Update, where index 0 is the operation name
Результат integer
    protected function sortUpdates(array $a, array $b)
    {
        $updateOrder = array('flush', 'cas', 'replace', 'add', 'touch', 'increment', 'decrement', 'set', 'setMulti', 'delete', 'deleteMulti');
        if ($a[0] === $b[0]) {
            return 0;
        }
        return array_search($a[0], $updateOrder) < array_search($b[0], $updateOrder) ? -1 : 1;
    }