Development

Changeset 5815

You must first sign up to be able to contribute.

Changeset 5815

Show
Ignore:
Timestamp:
11/02/07 16:53:31 (2 years ago)
Author:
fabien
Message:

added a sfPropel class to manage the default culture for i18n objects

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/plugins/sfPropelPlugin/lib/propel/builder/SfObjectBuilder.php

    r5767 r5815  
    177177    if (is_null($culture)) 
    178178    { 
    179       if (is_null($this->culture)) 
    180       { 
    181         throw new PropelException(sprintf(\'No culture is set for this "%s" object.\', get_class($this))); 
    182       } 
    183  
    184       $culture = $this->culture; 
     179      $culture = is_null($this->culture) ? sfPropel::getDefaultCulture() : $this->culture; 
    185180    } 
    186181 
  • trunk/lib/plugins/sfPropelPlugin/lib/propel/sfPropelAutoload.php

    r5093 r5815  
    1717require_once 'propel/Propel.php'; 
    1818 
     19$dispatcher = sfContext::getInstance()->getEventDispatcher(); 
     20 
    1921if (sfConfig::get('sf_debug') && sfConfig::get('sf_logging_enabled')) 
    2022{ 
     
    2527  // register our logger 
    2628  require_once(sfConfig::get('sf_symfony_lib_dir').'/plugins/sfPropelPlugin/lib/creole/drivers/sfDebugConnection.php'); 
    27   sfDebugConnection::setDispatcher(sfContext::getInstance()->getEventDispatcher()); 
     29  sfDebugConnection::setDispatcher($dispatcher); 
    2830} 
    2931 
     
    3133Propel::setConfiguration(sfPropelDatabase::getConfiguration()); 
    3234Propel::initialize(); 
     35 
     36sfPropel::initialize($dispatcher, sfContext::getInstance()->getUser()->getCulture()); 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.