22 lines
526 B
PHP

<?php
class Ticket extends \DB\SQL\Mapper {
function __construct($db){
parent::__construct($db, 'tickets');
}
public function findById($id){
$this->load(['id = ?', $id]);
return $this;
}
public function attachments(){
$attachment = new Attachment($this->db);
return $attachment->findWithUserByTicketId($this->id);
}
public function comments(){
$comment = new Comment($this->db);
return $comment->findWithUserByTicketId($this->id);
}
}