Skip to content

Commit

Permalink
ORM::factory() in K24 does not allow you to specify an alternate key
Browse files Browse the repository at this point in the history
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()
  • Loading branch information
bharat committed Dec 22, 2009
1 parent 8b9a020 commit 7118f84
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion modules/gallery/helpers/l10n_scanner.php
Expand Up @@ -42,7 +42,7 @@ static function process_message($message, &$cache) {
return $cache[$key];
}

$entry = ORM::factory("incoming_translation", array("key" => $key));
$entry = ORM::factory("incoming_translation")->where("key", "=", $key)->find();
if (!$entry->loaded()) {
$entry->key = $key;
$entry->message = serialize($message);
Expand Down
2 changes: 1 addition & 1 deletion modules/gallery/helpers/module.php
Expand Up @@ -51,7 +51,7 @@ static function set_version($module_name, $version) {
*/
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];
}
Expand Down

0 comments on commit 7118f84

Please sign in to comment.