<?php
App::uses('AppModel', 'Model');
class EventAttendee extends AppModel 
{
    public $name = 'EventAttendee';
    public $useTable = 'event_attendees';
    
    public $belongsTo = array('Event','User');
    
    public function isOwnedBy($item, $user) 
    {
        return $this->field('id', array('id' => $item, 'user_id' => $user)) !== false;
    }
}