Attendize/app/Models/Message.php

32 lines
632 B
PHP
Raw Normal View History

2016-02-29 15:59:36 +00:00
<?php namespace App\Models;
/*
Attendize.com - Event Management & Ticketing
*/
/**
* Description of Message
*
* @author Dave
*/
class Message extends MyBaseModel {
public function event() {
return $this->belongsTo('\App\Models\Event');
}
public function getRecipientsLabelAttribute() {
if($this->recipients == 0) {
return 'All Attendees';
}
$ticket = Ticket::scope()->find($this->recipients);
return 'Ticket: '.$ticket->title;
}
public function getDates() {
return array('created_at', 'updated_at', 'sent_at');
}
}