Changeset 3493
- Timestamp:
- 02/18/07 10:23:10 (2 years ago)
- Files:
-
- branches/1.0/data/config/settings.yml (modified) (1 diff)
- branches/1.0/data/skeleton/app/app/config/settings.yml (modified) (1 diff)
- branches/1.0/lib/addon/propel/builder/SfObjectBuilder.php (modified) (1 diff)
- branches/1.0/lib/addon/propel/database/sfPropelDataRetriever.class.php (added)
- branches/1.0/lib/addon/propel/database/sfPropelDatabase.class.php (modified) (1 diff)
- branches/1.0/lib/util/sfContext.class.php (modified) (1 diff)
- branches/1.0/test/functional/fixtures/project/lib/model/om/BaseArticle.php (modified) (1 diff)
- branches/1.0/test/functional/fixtures/project/lib/model/om/BaseAuthor.php (modified) (1 diff)
- branches/1.0/test/functional/fixtures/project/lib/model/om/BaseAuthorArticle.php (modified) (1 diff)
- branches/1.0/test/functional/fixtures/project/lib/model/om/BaseBook.php (modified) (1 diff)
- branches/1.0/test/functional/fixtures/project/lib/model/om/BaseCategory.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.0/data/config/settings.yml
r3043 r3493 78 78 path_info_key: PATH_INFO 79 79 url_format: PATH 80 80 81 # ORM 82 orm: propel branches/1.0/data/skeleton/app/app/config/settings.yml
r2919 r3493 99 99 # path_info_key: PATH_INFO 100 100 # url_format: PATH 101 # 102 # # ORM 103 # orm: propel branches/1.0/lib/addon/propel/builder/SfObjectBuilder.php
r3439 r3493 89 89 } 90 90 91 ";92 }93 94 protected function addConstants(&$script)95 {96 parent::addConstants($script);97 $script .= "98 /** the default database name for this class */99 const DATABASE_NAME = '{$this->getDatabase()->getName()}';100 91 "; 101 92 } branches/1.0/lib/addon/propel/database/sfPropelDatabase.class.php
r3201 r3493 112 112 $this->setParameter($key, $value); 113 113 } 114 115 public function retrieveObjects($class, $peerMethod = null)116 {117 if (!$classPath = sfCore::getClassPath($class.'Peer'))118 {119 throw new sfException(sprintf('Unable to find path for class "%s".', $class.'Peer'));120 }121 122 require_once($classPath);123 124 if (!$peerMethod)125 {126 $peerMethod = 'doSelect';127 }128 129 $classPeer = $class.'Peer';130 131 if (!is_callable(array($classPeer, $peerMethod)))132 {133 throw new sfException(sprintf('Peer method "%s" not found for class "%s"', $peerMethod, $classPeer));134 }135 136 $objects = call_user_func(array($classPeer, $peerMethod), new Criteria());137 138 return $objects;139 }140 114 } branches/1.0/lib/util/sfContext.class.php
r3077 r3493 163 163 public function retrieveObjects($class, $peerMethod) 164 164 { 165 return $this->databaseManager->getDatabase(constant("$class::DATABASE_NAME"))->retrieveObjects($class, $peerMethod); 165 $retrievingClass = 'sf'.ucfirst(sfConfig::get('sf_orm', 'propel')).'DataRetriever'; 166 167 return call_user_func(array($retrievingClass, 'retrieveObjects'), $class, $peerMethod); 166 168 } 167 169 branches/1.0/test/functional/fixtures/project/lib/model/om/BaseArticle.php
r3335 r3493 5 5 6 6 7 8 const DATABASE_NAME = 'propel';9 7 10 8 branches/1.0/test/functional/fixtures/project/lib/model/om/BaseAuthor.php
r2813 r3493 5 5 6 6 7 8 const DATABASE_NAME = 'propel';9 7 10 8 branches/1.0/test/functional/fixtures/project/lib/model/om/BaseAuthorArticle.php
r2813 r3493 5 5 6 6 7 8 const DATABASE_NAME = 'propel';9 7 10 8 branches/1.0/test/functional/fixtures/project/lib/model/om/BaseBook.php
r3335 r3493 5 5 6 6 7 8 const DATABASE_NAME = 'propel';9 7 10 8 branches/1.0/test/functional/fixtures/project/lib/model/om/BaseCategory.php
r3335 r3493 4 4 abstract class BaseCategory extends BaseObject implements Persistent { 5 5 6 7 8 const DATABASE_NAME = 'propel';9 6 10 7