<?php class Model_User extends \Orm\Model { protected static $_has_many = array('events', 'attendees', 'friends'); protected static $_observers = array( 'Orm\Observer_CreatedAt' => array( 'events' => array('before_insert'), 'mysql_timestamp' => false, ), 'Orm\Observer_UpdatedAt' => array( 'events' => array('before_save'), 'mysql_timestamp' => false, ), ); public static function upcoming_events() { $query = Model_Event::find() ->where('start_date', '>=', date('m/d/Y')) ->where('user_id', $this->id) ->get(); return $query; }
ErrorException [ Error ]: Using $this when not in object context
It looks like you're new here. If you want to get involved, click one of these buttons!