How to change the query value using hook_views_query_alter? I am having a problem trying to change the query output on my view.

I am using this code:

function zed_views_query_alter(&amp;$view, &amp;$query){
  if ($view-&gt;name == 'questions_home' &amp;&amp; $view-&gt;current_display == 'rates_related') {
    $or = db_or();
    dpr($query-&gt;where[1]['conditions'][2]['field']-&gt;condition());
  }
}


I am trying to alter the word %california%. The output is the following one. 

DatabaseCondition Object
(
    [conditions:protected] =&gt; Array
        (
            [#conjunction] =&gt; OR
            [0] =&gt; Array
                (
                    [field] =&gt; node.title
                    [value] =&gt; %california%
                    [operator] =&gt; LIKE
                )

            [1] =&gt; Array
                (
                    [field] =&gt; 
                    [value] =&gt; 
                    [operator] =&gt; IS NULL
                )

        )

    [arguments:protected] =&gt; Array
        (
        )

    [changed:protected] =&gt; 1
    [queryPlaceholderIdentifier:protected] =&gt; 
)


How can I go about changing the value %california%?
function zed_views_query_alter(&amp;$view, &amp;$query) {
  if ($view-&gt;name == 'questions_home' &amp;&amp; $view-&gt;current_display == 'rates_related') {
    foreach($query-&gt;where[1]['conditions'] as $idx =&gt; $condition) {
      if (!is_object($condition['field']) &amp;&amp; $condition['field'] == 'node.title') {
        $query-&gt;where[1]['conditions'][$idx]['value'] = '%whateveryoulike%';
        // or you can unset this condition and write down a new one
        // unset($query-&gt;where[1]['conditions'][$idx]);
        // $query-&gt;add_where_expression('1', "$field LIKE %" . db_like("california") . "% OR field LIKE %" . db_like("somethingelse") . "%");
      }
    }
    dpr($query-&gt;where[1]['conditions']);
  }
}