commit
10b8732583
|
@ -7,7 +7,14 @@ class Pivot extends Model {
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
*/
|
*/
|
||||||
public $pivot_table;
|
protected $pivot_table;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The database connection used for this model.
|
||||||
|
*
|
||||||
|
* @var Laravel\Database\Connection
|
||||||
|
*/
|
||||||
|
protected $pivot_connection;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Indicates if the model has update and creation timestamps.
|
* Indicates if the model has update and creation timestamps.
|
||||||
|
@ -26,7 +33,7 @@ class Pivot extends Model {
|
||||||
public function __construct($table, $connection = null)
|
public function __construct($table, $connection = null)
|
||||||
{
|
{
|
||||||
$this->pivot_table = $table;
|
$this->pivot_table = $table;
|
||||||
static::$connection = $connection;
|
$this->pivot_connection = $connection;
|
||||||
|
|
||||||
parent::__construct(array(), true);
|
parent::__construct(array(), true);
|
||||||
}
|
}
|
||||||
|
@ -41,4 +48,14 @@ public function table()
|
||||||
return $this->pivot_table;
|
return $this->pivot_table;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the connection used by the pivot table.
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public function connection()
|
||||||
|
{
|
||||||
|
return $this->pivot_connection;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue