meta.php 488 B

123456789101112131415161718192021222324
  1. <?php namespace System\DB\Eloquent;
  2. class Meta {
  3. /**
  4. * Get the table name for a model.
  5. *
  6. * @param string $class
  7. * @return string
  8. */
  9. public static function table($class)
  10. {
  11. // -----------------------------------------------------
  12. // Check for a table name override.
  13. // -----------------------------------------------------
  14. if (property_exists($class, 'table'))
  15. {
  16. return $class::$table;
  17. }
  18. return \System\Str::lower(\System\Inflector::plural($class));
  19. }
  20. }