WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru
функция не описана


Model::factory() public Yoast 1.0

Factory method used to acquire instances of the given class. The class name should be supplied as a string, and the class should already have been loaded by PHP (or a suitable autoloader should exist). This method actually returns a wrapped ORM object which allows a database query to be built. The wrapped ORM object is responsible for returning instances of the correct class when its find_one or find_many methods are called.

{} Это метод класса: Model{}

Хуков нет.


ORM. Instance of the ORM wrapper.


$result = Model::factory( $class_name );
$class_name(строка) (обязательный)
The target class name.

Код Model::factory() Yoast 17.1

public static function factory( $class_name ) {
	$class_name = static::$auto_prefix_models . $class_name;
	$table_name = static::get_table_name_for_class( $class_name );
	$wrapper    = ORM::for_table( $table_name );
	$wrapper->set_class_name( $class_name );
	$wrapper->use_id_column( static::get_id_column_name( $class_name ) );

	return $wrapper;