public static function destroyAll(array $objects, $useMasterKey = false)
    {
        $errors = [];
        $count = count($objects);
        if ($count)
        {
            $batchSize = 40;
            $processed = 0;
            $currentBatch = [];
            $currentcount = 0;
            while ($processed < $count)
            {
                $currentcount++;
                $currentBatch[] = $objects[$processed++];
                if ($currentcount == $batchSize || $processed == $count)
                {
                    $results = static::destroyBatch($currentBatch);
                    $errors = array_merge($errors, $results);
                    $currentBatch = [];
                    $currentcount = 0;
                }
            }
            if (count($errors))
            {
                throw new AVAggregateException("Errors during batch destroy.", $errors);
            }
        }

        return null;
    }