Show
Ignore:
Timestamp:
09/27/08 17:43:42 (3 months ago)
Author:
mikeseth
Message:

clear up confusion with the base model

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • documentation/trunk/topics/examples.xml

    r2748 r2951  
    4141 </configuration> 
    4242</configurations> 
     43</codeblock> 
     44<codeblock id="stage2-base-model"> 
     45  /** 
     46  * The base model from which all project models inherit. 
     47  */ 
     48 
     49class BlogBaseModel extends AgaviModel 
     50{ 
     51  /** 
     52   * Return the PDO resource needed to access the blog database 
     53   * @return PDO 
     54   */ 
     55  protected function getPdo() 
     56  { 
     57    // The connection parameters are configured in app/config/databases.xml 
     58    return $this->context->getDatabaseManager()->getDatabase()->getConnection('blog'); 
     59  } 
     60} 
     61 
     62?> 
    4363</codeblock> 
    4464<codeblock id="stage2-posts-model">