title: Object of class could not be converted to string error
body: <p>I am receiving the following error below on the object's function in Smarty and I am unaware of how to resolve the issue. </p>
  
  <p>Error: </p>
  
  <pre><code>Catchable fatal error: Object of class users_class could not be converted to string
  </code></pre>
  
  <p>This is the following object and function of the object I am using.</p>
  
  <pre><code>class users_class
  {
      public function fetchUser(array $conditions)
      {
          $db = Core::getInstance();
          $sql = "SELECT * FROM ".USERS." WHERE ";
          $i=0;
          $params = array();
          //$where = array();
          foreach ($conditions as $column =&gt; $value)
          {
              if (preg_match('/^[a-z-.-_]+$/', $column)) {
                  if ($i!=0) {
                      $sql .= " AND ";
                  }
                  $sql .= "$column = ?";
                  $params[] = $value;
                  $i++;
              }
          }           
          //$sql .= implode(' AND ', $where);
          //$sql .= " order by title asc";    
          $res = $db-&gt;dbh-&gt;prepare($sql);
          $res-&gt;execute(array_values($params));
          return $res-&gt;fetch(PDO::FETCH_ASSOC);               
      }
  }
  </code></pre>
  
  <p>This is the call in Smarty:</p>
  
  <pre><code> {section name=ststval loop=$ststres}
      {if $ststres[ststval].type == 2}
         {assign var='udatas' value="$userObj-&gt;fetchUser(array('id'=&gt;$ststres[ststval].to_id));"}
  </code></pre>