lithium\data\source\http\adapter\CouchDb::conditions()

public method

Handle conditions.

Parameters

  • string $conditions
  • string $context

Returns

array

Source

	public function conditions($conditions, $context) {
		$path = null;
		if (isset($conditions['design'])) {
			$paths = ['design', 'view'];
			foreach ($paths as $element) {
				if (isset($conditions[$element])) {
					$path .= "_{$element}/{$conditions[$element]}/";
					unset($conditions[$element]);
				}
			}
		}
		if (isset($conditions['id'])) {
			$path = "{$conditions['id']}";
			unset($conditions['id']);
		}
		if (isset($conditions['path'])) {
			$path = "{$conditions['path']}";
			unset($conditions['path']);
		}
		return [$path, $conditions];
	}