public static function updateSObjectFields(SObject $sob, $fields) {
			if (!is_array($fields) && !is_object($fields))
				throw new InvalidArgumentException('$fields must be an array or object');

			if (is_object($sob->fields))
				$fields = (object)$fields;

			$sob->fields = $fields;

			return $sob;
		}
public static function updateSObjectFields(SObject $sob, $fields) {
			if (!is_array($fields) && !is_object($fields))
				throw new InvalidArgumentException('$fields must be an array or object');

			if (is_object($sob->fields))
				$fields = (object)$fields;

			$sob->fields = $fields;

			return $sob;
		}
public static function updateSObjectFields ( SObject $ sob , $ fields ) { if ( ! is_array ( $ fields ) && ! is_object ( $ fields ) ) throw new InvalidArgumentException ( '$fields must be an array or object' ) ; if ( is_object ( $ sob -> fields ) ) $ fields = ( object ) $ fields ; $ sob -> fields = $ fields ; return $ sob ; }
Updates an SObject's fields member using either an object or an associative array.

@throws InvalidArgumentException if $fields is not an array or an object

@param  SObject $sob    the SObject to update
@param  array|object  $fields the array or object to update the fields member from
@return SObject         the updated SObject for chaining
Updates an SObject s fields member using either an object or an associative array .