Yoast\WP\Lib
ORM::build_conditions() protected Yoast 1.0
Builds a WHERE or HAVING clause.
{} Это метод класса: ORM{}
Хуков нет.
Возвращает
Строку.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->build_conditions( $type );
- $type(строка) (обязательный)
- Where or having.
Код ORM::build_conditions() ORM::build conditions Yoast 15.9
protected function build_conditions( $type ) {
$conditions_class_property_name = "{$type}_conditions";
// If there are no clauses, return empty string.
if ( \count( $this->{$conditions_class_property_name} ) === 0 ) {
return '';
}
$conditions = [];
foreach ( $this->{$conditions_class_property_name} as $condition ) {
$conditions[] = $condition[ self::CONDITION_FRAGMENT ];
$this->values = \array_merge( $this->values, $condition[ self::CONDITION_VALUES ] );
}
return \strtoupper( $type ) . ' ' . \join( ' AND ', $conditions );
}