BUGFIX: Replaced ManifestBuilder::has_been_included() with SS_ClassLoader::hasManifest().

This commit is contained in:
Sam Minnee 2011-05-01 17:12:26 +12:00
parent 2365bfc652
commit a15b6941a6
2 changed files with 8 additions and 1 deletions

View File

@ -34,6 +34,13 @@ class SS_ClassLoader {
public function getManifest() {
return $this->manifests[count($this->manifests) - 1];
}
/**
* Returns true if this class loader has a manifest.
*/
public function hasManifest() {
return (bool)$this->manifests;
}
/**
* Pushes a class manifest instance onto the top of the stack. This will

View File

@ -76,7 +76,7 @@ class DataQuery {
// Error checking
if(!$tableClasses) {
if(!ManifestBuilder::has_been_included()) {
if(!SS_ClassLoader::instance()->hasManifest()) {
user_error("DataObjects have been requested before the manifest is loaded. Please ensure you are not querying the database in _config.php.", E_USER_ERROR);
} else {
user_error("DataObject::buildSQL: Can't find data classes (classes linked to tables) for $this->dataClass. Please ensure you run dev/build after creating a new DataObject.", E_USER_ERROR);