1: <?php namespace Laravel\Database\Eloquent;
2:
3: class Pivot extends Model {
4:
5: /**
6: * The name of the pivot table's table.
7: *
8: * @var string
9: */
10: protected $pivot_table;
11:
12: /**
13: * The database connection used for this model.
14: *
15: * @var Laravel\Database\Connection
16: */
17: protected $pivot_connection;
18:
19: /**
20: * Indicates if the model has update and creation timestamps.
21: *
22: * @var bool
23: */
24: public static $timestamps = true;
25:
26: /**
27: * Create a new pivot table instance.
28: *
29: * @param string $table
30: * @param string $connection
31: * @return void
32: */
33: public function __construct($table, $connection = null)
34: {
35: $this->pivot_table = $table;
36: $this->pivot_connection = $connection;
37:
38: parent::__construct(array(), true);
39: }
40:
41: /**
42: * Get the name of the pivot table.
43: *
44: * @return string
45: */
46: public function table()
47: {
48: return $this->pivot_table;
49: }
50:
51: /**
52: * Get the connection used by the pivot table.
53: *
54: * @return string
55: */
56: public function connection()
57: {
58: return $this->pivot_connection;
59: }
60:
61: }