meta.php 488 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
<?php namespace System\DB\Eloquent;

class Meta {

	/**
	 * Get the table name for a model.
	 *
	 * @param  string  $class
	 * @return string
	 */
	public static function table($class)
	{
		// -----------------------------------------------------
		// Check for a table name override.
		// -----------------------------------------------------
		if (property_exists($class, 'table'))
		{
			return $class::$table;
		}

		return \System\Str::lower(\System\Inflector::plural($class));
	}

}