upskill-event-manager/includes/trait-hvac-singleton.php
ben 60e7ae33af feat: implement Phase 1A native WordPress event form system
 HVAC_Event_Form_Builder Implementation:
- Native WordPress event form builder extending HVAC_Form_Builder
- Complete datetime field types (start/end dates, timezone, all-day)
- Comprehensive venue field group (name, address, capacity, coordinates)
- Organizer field group (name, email, phone, website) with validation
- HVAC-specific fields (trainer requirements, certifications, equipment)
- Featured image upload support with security validation
- WordPress-native security integration (nonces, sanitization)
- Comprehensive form validation and error handling

🏗️ Architecture Improvements:
- Extract HVAC_Singleton_Trait to standalone file for better organization
- Add proper file loading order in HVAC_Plugin class
- Include core security framework and form builder dependencies

🧪 Testing Infrastructure:
- Native event test template for Phase 1A validation
- Staging deployment and testing completed successfully
- All form fields render and validate correctly

🎯 Strategic Progress:
- Phase 1A complete: Native form foundation established
- Eliminates dependency on problematic TEC Community Events forms
- Provides foundation for Phase 1B tribe_events post creation

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 15:48:09 -03:00

59 lines
No EOL
1.1 KiB
PHP

<?php
declare(strict_types=1);
/**
* HVAC Singleton Trait
*
* Provides singleton pattern implementation for HVAC classes
* Ensures memory efficiency and single instance management
*
* @package HVAC_Community_Events
* @subpackage Includes
* @since 3.0.0
*/
if (!defined('ABSPATH')) {
exit;
}
/**
* Trait HVAC_Singleton_Trait
*
* Memory-efficient singleton implementation for HVAC classes
*/
trait HVAC_Singleton_Trait {
/**
* Single instance of the class
*
* @var static|null
*/
private static ?self $instance = null;
/**
* Get singleton instance
*
* @return static
*/
public static function instance(): self {
if (self::$instance === null) {
self::$instance = new self();
}
return self::$instance;
}
/**
* Prevent cloning
*/
private function __clone() {}
/**
* Prevent unserialization
*
* @throws Exception
*/
public function __wakeup() {
throw new Exception("Cannot unserialize singleton");
}
}