25 lines
440 B
PHP
Executable File
25 lines
440 B
PHP
Executable File
<?php
|
|
|
|
namespace Model;
|
|
|
|
class ProgramHost extends Model {
|
|
public $id;
|
|
public $name;
|
|
public $email;
|
|
|
|
public function __construct($data) {
|
|
// Convert arrays to objects for consistent handling
|
|
if(is_array($data)) {
|
|
$data = (object) $data;
|
|
}
|
|
|
|
parent::__construct($data);
|
|
|
|
// Ensure name is a string, not an array
|
|
if(is_array($this->name)) {
|
|
$this->name = $this->name[0] ?? '';
|
|
}
|
|
}
|
|
}
|
|
|