Yoast\WP\Lib
Model::of_type()
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.
По умолчанию: true
Код Model::of_type() Model::of type Yoast 22.4
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 ); }