Yoast\WP\Lib

ORM::get_compound_id_column_values()protectedYoast 1.0

Filters a column/value array returning only those columns that belong to a compound primary key.

If the key contains a column that does not exist in the given array, a null value will be returned for it.

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

Хуков нет.

Возвращает

Массив.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_compound_id_column_values( $value );
$value(разное) (обязательный)
The value.

Код ORM::get_compound_id_column_values() Yoast 22.4

protected function get_compound_id_column_values( $value ) {
	$filtered = [];
	foreach ( $this->get_id_column_name() as $key ) {
		$filtered[ $key ] = ( $value[ $key ] ?? null );
	}

	return $filtered;
}