_get_table_name() protected static method

If the supplied class has a public static property named $_table, the value of this property will be returned. If not, the class name will be converted using the _class_name_to_table_name method method. If Model::$short_table_names == true or public static property $_table_use_short_name == true then $class_name passed to _class_name_to_table_name is stripped of namespace information.
protected static _get_table_name ( string $class_name ) : string
$class_name string
return string
Example #1
0
 /**
  * Returns an ORM instance for the table attached to the model. Because
  * of the need for late static binding this only works for PHP >= 5.3. 
  * For PHP < 5.3 the following must be placed in each of the subclassing 
  * models:
  * 
  *     public static function objects() { 
  *         return parent::objects(__CLASS__); 
  *     }
  * 
  * @param type $class_name
  * @return type ORM
  */
 public static function objects($class_name = null)
 {
     $has_late_static_binding = function_exists('get_called_class');
     if (!$has_late_static_binding && is_null($class_name)) {
         throw Exception('PHP versions < 5.3 must override the objects' . 'method.');
     }
     if ($has_late_static_binding && is_null($class_name)) {
         $class_name = get_called_class();
     }
     $table_name = Model::_get_table_name($class_name);
     return ORM::for_table($table_name);
 }