Yoast\WP\Lib
ORM::create_model_instance
Creates an instance of the model class associated with this wrapper and populate it with the supplied Idiorm instance.
Метод класса: ORM{}
Хуков нет.
Возвращает
true|false|Model. Instance of the model class.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->create_model_instance( $orm );
- $orm(ORM) (обязательный)
- The ORM used by model.
Код ORM::create_model_instance() ORM::create model instance Yoast 26.7
protected function create_model_instance( $orm ) {
if ( $orm === false ) {
return false;
}
/**
* An instance of Model is being made.
*
* @var Model $model
*/
$model = new $this->class_name();
$model->set_orm( $orm );
return $model;
}