/** * Save an object to the database (either INSERT or UPDATE) * * @param Model $object * * @return bool */ public static function save(Model &$object) { if ($object->_isLoaded()) { if ($object->_isDirty()) { return self::update($object); } } else { return self::insert($object); } }