pivot.php 510 B

1234567891011121314151617181920212223242526272829303132333435
  1. <?php namespace Laravel\Database\Eloquent;
  2. class Pivot extends Model {
  3. /**
  4. * The name of the pivot table's table.
  5. *
  6. * @var string
  7. */
  8. public $pivot_table;
  9. /**
  10. * Create a new pivot table instance.
  11. *
  12. * @param string $table
  13. * @return void
  14. */
  15. public function __construct($table)
  16. {
  17. $this->pivot_table = $table;
  18. parent::__construct(array(), true);
  19. }
  20. /**
  21. * Get the name of the pivot table.
  22. *
  23. * @return string
  24. */
  25. public function table()
  26. {
  27. return $this->pivot_table;
  28. }
  29. }