<?php
/**
 * Invoice Item Service Provider Class
 *
 * @package Easy_Invoice
 * @subpackage Providers
 */

namespace EasyInvoice\Providers;

use EasyInvoice\Interfaces\InvoiceItemRepositoryInterface;
use EasyInvoice\Repositories\InvoiceItemRepository;

/**
 * InvoiceItemServiceProvider Class
 * 
 * Handles registration of invoice item-related services.
 */
class InvoiceItemServiceProvider {
    /**
     * The repository instance
     *
     * @var InvoiceItemRepositoryInterface
     */
    protected static $repository = null;
    
    /**
     * Register invoice item services
     */
    public function register() {
        // Register invoice item repository
        $this->registerInvoiceItemRepository();
    }
    
    /**
     * Register invoice item repository
     */
    protected function registerInvoiceItemRepository() {
        // Create and store the repository instance
        self::$repository = new InvoiceItemRepository();
    }
    
    /**
     * Get the invoice item repository
     *
     * @return InvoiceItemRepositoryInterface The invoice item repository
     */
    public static function getInvoiceItemRepository() {
        // Create the repository if it doesn't exist
        if (self::$repository === null) {
            self::$repository = new InvoiceItemRepository();
        }
        
        return self::$repository;
    }
} 