Yoast\WP\Lib

ORM::count_null_id_columns()publicYoast 1.0

Counts the number of columns that belong to the primary key and their value is null.

Метод класса: ORM{}

Хуков нет.

Возвращает

int. The amount of null columns.

Использование

$ORM = new ORM();
$ORM->count_null_id_columns();

Код ORM::count_null_id_columns() Yoast 22.3

public function count_null_id_columns() {
	if ( \is_array( $this->get_id_column_name() ) ) {
		return \count( \array_filter( $this->id(), 'is_null' ) );
	}
	else {
		return \is_null( $this->id() ) ? 1 : 0;
	}
}