Fixing bugs… adding better pivot support.
Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
35
laravel/database/eloquent/pivot.php
Normal file
35
laravel/database/eloquent/pivot.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php namespace Laravel\Database\Eloquent;
|
||||
|
||||
class Pivot extends Model {
|
||||
|
||||
/**
|
||||
* The name of the pivot table's table.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $pivot_table;
|
||||
|
||||
/**
|
||||
* Create a new pivot table instance.
|
||||
*
|
||||
* @param string $table
|
||||
* @return void
|
||||
*/
|
||||
public function __construct($table)
|
||||
{
|
||||
$this->pivot_table = $table;
|
||||
|
||||
parent::__construct(array(), true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the pivot table.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function table()
|
||||
{
|
||||
return $this->pivot_table;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user