Public feed #893367

Untitled

public text v1 · immutable
Raw Edit
·published 2008-02-06 01:51 UTC
rendered paste body
	/**
	 * Method: in
	 *  Adds a piece to the where clause where condition 
	 * Parameters:
	 * 	field - the name of the column that's being checked
	 *  values - an array of values the field should be checked against
	 * 	
	 * Returns:
	 *   the <Database> Object
	 */
	function in($field, array $values) {
		$escaped_values = array();
		foreach ($values as $v) {
			$escaped_values[] = $this->driver->escape_string($v);
		}
		$this->where($this->escape_column($field) . ' IN(' . implode(',', $escaped_values) .')');
		
		return $this;
	}