46 lines
976 B
PHP
46 lines
976 B
PHP
<?php
|
|
class Boleto {
|
|
private $id;
|
|
private $fila;
|
|
private $numero;
|
|
private $precio;
|
|
private $estado; // 'disponible' o 'vendido'
|
|
|
|
public function __construct($id, $fila, $numero, $precio) {
|
|
$this->id = $id;
|
|
$this->fila = $fila;
|
|
$this->numero = $numero;
|
|
$this->precio = $precio;
|
|
$this->estado = 'disponible';
|
|
}
|
|
|
|
// Getters y setters
|
|
public function getId() {
|
|
return $this->id;
|
|
}
|
|
|
|
public function getFila() {
|
|
return $this->fila;
|
|
}
|
|
|
|
public function getNumero() {
|
|
return $this->numero;
|
|
}
|
|
|
|
public function getPrecio() {
|
|
return $this->precio;
|
|
}
|
|
|
|
public function getEstado() {
|
|
return $this->estado;
|
|
}
|
|
|
|
public function marcarComoVendido() {
|
|
$this->estado = 'vendido';
|
|
return true;
|
|
}
|
|
|
|
public function estaDisponible() {
|
|
return $this->estado === 'disponible';
|
|
}
|
|
} |