Yoast\WP\Lib
Model::of_type() public Yoast 1.0
Hacks around the Model to provide WordPress prefix to tables.
{} Это метод класса: Model{}
Хуков нет.
Возвращает
ORM
. Wrapper to use.
Использование
$result = Model::of_type( $class_name, $yoast_prefix );
- $class_name(строка) (обязательный)
- Type of Model to load.
- $yoast_prefix(true|false)
- True to prefix the table name with the Yoast prefix.
Код Model::of_type() Model::of type Yoast 16.1.1
public static function of_type( $class_name, $yoast_prefix = true ) {
// Prepend namespace to the class name.
$class = static::$auto_prefix_models . $class_name;
// Set the class variable to the custom value based on the WPDB prefix.
$class::$table = static::get_table_name( $class_name, $yoast_prefix );
return static::factory( $class_name, null );
}