HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/www/wp-content/plugins/give/src/Campaigns/ListTable/Columns/StatusColumn.php
<?php

namespace Give\Campaigns\ListTable\Columns;

use Give\Campaigns\Models\Campaign;
use Give\Framework\ListTable\ModelColumn;

/**
 * @since 4.0.0
 */
class StatusColumn extends ModelColumn
{
    /**
     * @since 4.0.0
     */
    public static function getId(): string
    {
        return 'status';
    }

    /**
     * @since 4.0.0
     */
    public function getLabel(): string
    {
        return __('Status', 'give');
    }

    /**
     * @since 4.0.0
     *
     * @param Campaign $model
     */
    public function getCellValue($model)
    {
        switch ($model->status->getValue()) {
            case 'active':
                $statusLabel = __('Active', 'give');
                break;
            case 'inactive':
                $statusLabel = __('Inactive', 'give');
                break;
            case 'archived':
                $statusLabel = __('Archived', 'give');
                break;
            case 'draft':
                $statusLabel = __('Draft', 'give');
                break;
            case 'pending':
                $statusLabel = __('Pending', 'give');
                break;
            case 'processing':
                $statusLabel = __('Processing', 'give');
                break;
            case 'failed':
                $statusLabel = __('Failed', 'give');
                break;
            default:
                $statusLabel = __('Draft', 'give');
        }

        return sprintf(
            '<div class="statusBadge statusBadge--%1$s"><p>%2$s</p></div>',
            $model->status->getValue(),
            $statusLabel
        );
    }
}