diff options
Diffstat (limited to 'modules/gallery/libraries/MY_ORM.php')
| -rw-r--r-- | modules/gallery/libraries/MY_ORM.php | 11 | 
1 files changed, 11 insertions, 0 deletions
| diff --git a/modules/gallery/libraries/MY_ORM.php b/modules/gallery/libraries/MY_ORM.php index d4cdedb8..ac61e75b 100644 --- a/modules/gallery/libraries/MY_ORM.php +++ b/modules/gallery/libraries/MY_ORM.php @@ -18,6 +18,17 @@   * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.   */  class ORM extends ORM_Core { + +  /** +   * Make sure that we're only using integer ids. +   */ +  static function factory($model, $id=null) { +    if ($id && !is_int($id)) { +      throw new Exception("@todo ORM::factory requires integer ids"); +    } +    return ORM_Core::factory($model, $id); +  } +    public function save() {      model_cache::clear();      return parent::save(); | 
