title: Using a namespace in an extended class
body: <p>I'm using Propel together with CodeIgniter.  I made a <code>MY_Model</code> class (which extends <code>CI_Model</code>) that uses its constructor to load Propel.</p>
  
  <p>In case you're curious:</p>
  
  <pre><code>class MY_Model extends CI_Model{
      public function __construct(){
          parent::__construct();
  
          require_once '/propel/runtime/lib/Propel.php';
          Propel::init('/build/conf/project-conf.php');
          set_include_path('/build/classes'.PATH_SEPARATOR.get_include_path());
      }
  }
  </code></pre>
  
  <p>So, now when I make a new CodeIgniter model, it will load up Propel for me.  Thing is, I added namespaces to a few of the Propel-generated models.  I figured I could add the <code>use Reports;</code> line inside the model's constructor, but nope.</p>
  
  <pre><code>class Reports_model extends MY_Model{
      function __construct(){
          parent::__construct();
          use Reports;
      }
  }
  </code></pre>
  
  <p>This gives me</p>
  
  <blockquote>
    <p>syntax error, unexpected T_USE</p>
  </blockquote>
  
  <p>Ok, I thought, let's try putting it outside the constructor: </p>
  
  <pre><code>class Reports_model extends MY_Model{
      use Reports;
  
      function __construct(){
          parent::__construct();
      }
  }
  </code></pre>
  
  <p>Now I get a longer error:</p>
  
  <blockquote>
    <p>syntax error, unexpected T_USE, expecting T_FUNCTION</p>
  </blockquote>
  
  <p>As a last resort, I added the <code>use Reports;</code> before the class declaration:</p>
  
  <pre><code>use Reports;
  
  class Reports_model extends MY_Model{
      function __construct(){
          parent::__construct();
      }
  }
  </code></pre>
  
  <p>Now I get even more errors!</p>
  
  <blockquote>
    <p>The use statement with non-compound name 'Reports' has no effect<br>
    Class 'ReportsQuery' not found</p>
  </blockquote>
  
  <p>In another function in the class, I have a line that does <code>$report = ReportsQuery::create();</code>.</p>
  
  <p>So, how can I get the <code>use Reports;</code> line to work?  I really don't feel like adding <code>Reports\</code> <em>everywhere</em>.</p>
  
  <p>How can I make it so I can do:</p>
  
  <pre><code>$report = ReportsQuery::create();
  </code></pre>
  
  <p>instead of:</p>
  
  <pre><code>$report = Reports\ReportsQuery::create();
  </code></pre>