title: Escaping Fields Array in CakePHP
body: <p>I currently have:</p>
  
  <pre><code>$subQuery = $dbo-&gt;buildStatement(
          array(
              'fields' =&gt; array(
                  "CASE
                      WHEN
                          Application.program_type_id = 3
                          AND Application.program_type_id IS NOT NULL
                          THEN {$keys['program_type_id_program_type_id']}
                          ELSE 0
                  END as program_type_score,
                  CASE
                      WHEN
                          Application.priority_subject_area_id = 1
                          AND Application.priority_subject_area_id IS NOT NULL
                          THEN {$keys['priority_subject_area_id_priority_subject_area_id']}
                          ELSE 0
                  END as priority_subject_area_priority_subject_area_score,
                  User.*"
              ),
              'table' =&gt; $dbo-&gt;fullTableName($this),
              'alias' =&gt; 'User',
              'limit' =&gt; null,
              'offset' =&gt; null,
              'joins' =&gt; $joins,
              'conditions' =&gt; array(
                  'Application.state' =&gt; 'accepted',
                  'Role.role' =&gt; 'mentor'
              ),
              'order' =&gt; null,
              'group' =&gt; null
          ),
          $this-&gt;User
      );
  </code></pre>
  
  <p>I need to change the case statements from this:</p>
  
  <pre><code>CASE
                          WHEN
                              Application.program_type_id = 3
                              AND Application.program_type_id IS NOT NULL
                              THEN {$keys['program_type_id_program_type_id']}
                              ELSE 0
                      END as program_type_score
  </code></pre>
  
  <p>to this:</p>
  
  <pre><code>CASE
                          WHEN
                              Application.program_type_id = $user['User']['value']
                              AND Application.program_type_id IS NOT NULL
                              THEN {$keys['program_type_id_program_type_id']}
                              ELSE 0
                      END as program_type_score
  </code></pre>
  
  <p>How do I escape <code>$user['User']['value']</code>? Would Sanitize::escape() work, however, it is already deprecated.</p>