title: How to extend Silex Doctrine MySQL query library?
body: <p>As the title says, I'm using Silex and Doctrine. Though, I'd like to use some of my own simple classes to extend Doctrine. But I don't know what to put after 'extends ....?'. This is an example of how I would extend doctrine:</p>
  
  <pre><code>public function action($action, $table, $where = array()) {
      if(count($where) === 3) {
          $operators = array('=', '&gt;', '&lt;', '&gt;=', '&lt;=');
  
          $field = $where[0];
          $operator = $where[1];
          $value = $where[2];
  
          if(in_array($operator, $operators)) {
              $sql = "{$action} FROM {$table} WHERE {$field} {$operator} ?";
  
              if(!$this-&gt;query($sql, array($value))-&gt;error()) {
                  return $this;
              }
          }
  
      }
  
      return false;
  }
  </code></pre>
  
  <p>And this one:</p>
  
  <pre><code>public function insert($table, $fields = array()) {
      $keys = array_keys($fields);
      $values = null;
      $x = 1;
  
      foreach($fields as $field) {
          $values .= '?';
          if ($x &lt; count($fields)) {
              $values .= ', ';
          }
          $x++;
      }
  
      $sql = "INSERT INTO {$table} (`" . implode('`, `', $keys) . "`) VALUES ({$values})";
  
      if(!$this-&gt;query($sql, $fields)-&gt;error()) {
          return true;
      }
  
      return false;
  }
  </code></pre>
  
  <p>So, to create an external class that extends Doctrine. What would my class look like:</p>
  
  <blockquote>
    <p>class DB extends ... {</p>
    
    <p>//blablabla</p>
    
    <p>}</p>
  </blockquote>