Skip to content

Instantly share code, notes, and snippets.

@LeShadow
Created May 30, 2014 14:03
Show Gist options
  • Save LeShadow/b3ec33414981144d4d22 to your computer and use it in GitHub Desktop.
Save LeShadow/b3ec33414981144d4d22 to your computer and use it in GitHub Desktop.
<?php
class Schedule extends Eloquent {
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'schedule';
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = array();
protected $filleable = array('datetime','team_a_id','team_b_id','fieldtype');
protected $guarded = array();
public static $rules = array(
);
public $autoPurgeRedundantAttributes = true;
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getScheduleIdentifier()
{
return $this->getKey();
}
public function getRulesAttribute()
{
return self::$rules;
}
public function getTeamA()
{
return $this->hasOne('team', 'team_a_id');
}
public function getTeamB()
{
return $this->hasOne('team', 'team_b_id');
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment