pivot.php 637 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<?php namespace Laravel\Database\Eloquent;

class Pivot extends Model {

	/**
	 * The name of the pivot table's table.
	 *
	 * @var string
	 */
	public $pivot_table;

	/**
13 14 15 16 17 18 19
	 * Indicates if the model has update and creation timestamps.
	 *
	 * @var bool
	 */
	public static $timestamps = true;

	/**
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
	 * 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;
	}

}