Created
June 11, 2013 21:21
-
-
Save clone1018/5760823 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace CFS; | |
use Eloquent; | |
class File extends Eloquent { | |
protected $table = 'cfs_files'; | |
protected $guarded = array('id'); | |
protected $hidden = array('id'); | |
protected $touches = array('folder'); | |
public function folder() { | |
return $this->belongsTo('CFS\Folder'); | |
} | |
// ... | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace CFS; | |
use Eloquent; | |
class Folder extends Eloquent { | |
protected $table = 'cfs_folders'; | |
protected $guarded = array('id'); | |
public function files() { | |
return $this->hasMany('CFS\File', 'folder_id'); | |
} | |
// ... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment