Book.php 407 Bytes
Newer Older
Jens Segers's avatar
Jens Segers committed
1 2
<?php

3
use Jenssegers\Mongodb\Eloquent\Model as Eloquent;
Jens Segers's avatar
Jens Segers committed
4

Jens Segers's avatar
Jens Segers committed
5 6
class Book extends Eloquent
{
Jens Segers's avatar
Jens Segers committed
7 8 9
    protected $collection = 'books';
    protected static $unguarded = true;
    protected $primaryKey = 'title';
Jens Segers's avatar
Jens Segers committed
10 11 12 13 14

    public function author()
    {
        return $this->belongsTo('User', 'author_id');
    }
15 16 17 18 19 20

    public function mysqlAuthor()
    {
        return $this->belongsTo('MysqlUser', 'author_id');
    }
}