Details
-
Type:
Improvement
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.2.0-ALPHA2
-
Fix Version/s: 1.2.0-BETA1
-
Component/s: None
-
Labels:None
Description
Doctrine allows you to generate class names such as Blog_Model_Post in Post.php, but Doctrine::loadModels() is not able to load these models conservatively, as the class name and file name differ.
I suggest adding a third parameter to Doctrine_Core::loadModels() to specify a class prefix, for example:
Doctrine_Core::loadModels('/modules/blog/models', Doctrine_Core::MODEL_LOADING_CONSERVATIVE, 'Blog_Model_');
Code changes (I think) would be something like this:
public static function loadModels($directory, $modelLoading = null, $classPrefix = null) { ... $className = $e[0]; if ($classPrefix) { $className = $classPrefix . $className; } ... }
Since the argument is optional, this change shouldn't break any existing code.
NB: This is not PEAR-style file/class naming.
Activity
Jonathan H. Wage
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Status | Open [ 1 ] | Closed [ 6 ] |
| Fix Version/s | 1.2.0-BETA1 [ 10035 ] | |
| Resolution | Fixed [ 1 ] |
This list may be incomplete, as errors occurred whilst retrieving source from linked applications:
- Request to http://www.doctrine-project.org/fisheye/ failed: Error in remote call to 'FishEye 0 (http://www.doctrine-project.org/fisheye/)' (http://www.doctrine-project.org/fisheye) [AbstractRestCommand{path='/rest-service-fe/search-v1/crossRepositoryQuery', params={query=DC-127, expand=changesets[-21:-1].revisions[0:29],reviews}, methodType=GET}] : Received status code 503 (Service Temporarily Unavailable)