ORM::factory() in K24 does not allow you to specify an alternate key

for lookup.  So instead of doing:
  ORM::factory("foo", array("some_key" => "some_value"))

you have to do:
  ORM::factory("foo"->where("some_key", "=" "some_value")->find()
This commit is contained in:
Bharat Mediratta
2009-12-22 13:32:02 -08:00
parent 8b9a02084a
commit 7118f84aa9
2 changed files with 2 additions and 2 deletions

View File

@@ -51,7 +51,7 @@ class module_Core {
*/
static function get($module_name) {
if (empty(self::$modules[$module_name])) {
return ORM::factory("module", array("name" => $module_name));
return ORM::factory("module")->where("name", "=", $module_name)->find();
}
return self::$modules[$module_name];
}