1
nayeem
isDirty and image
  • 2004/6/14 9:52

  • nayeem

  • Just popping in

  • Posts: 44

  • Since: 2004/1/3 1


whats the isDirty method used for in XoopsObject class. Is there some example codes where its used?

Also I saw a lot of image classes (image, imageset etc). But didnt notice them being used anywhere in the xoops. Whats this about? is it part of a future extension plan?

any help would be greatly appreciated as I am working on developing some modules and want to use the XOOPS wonderful core technology.

thanks

nayeem

2
Mithrandir
Re: isDirty and image

isDirty() is usually used when saving the object (with the insert() method on the handler class) to determine whether it needs to be written to the database. If the object is clean, it means that it corresponds with the original object and it is not necessary to perform an update SQL.

To my knowledge, the image classes are used by the core ImageHandler - e.g. when inserting an image in a XoopsFormDhtmlArea field.

3
nayeem
Re: isDirty and image
  • 2004/6/14 10:33

  • nayeem

  • Just popping in

  • Posts: 44

  • Since: 2004/1/3 1


clear on the isDirty now thanks!

so can the image classes be used/extended to make a gallery system? Or is it better off writing seperate classes for that?
I was thinking of creating the following classes in the module :
image
imageset
album
albumset
category
categoryset
and respective handler classes to handle db interface.

From what i understand so far i would have them all derive from Objects and objecthandler classes and I could use the error_handler, db, tpl and the Textsanitizer objects to allow the respective functionalities. Just running it by to make sure I am in the right path.

thanks,

nayeem

4
Mithrandir
Re: isDirty and image

I think you are on the right track.

An "album" may need to be made by you, but if there are core classes already in place which are useful, use them - that's why they are there

Depending on your needs for a category class, you could use the XoopsTopic - also depending on whether you would need independent categories in the gallery system, since the XoopsTopic class is also used by the News module.

If you need more than that, you can always extend e.g. XoopsTopic with your category class and just override the methods, you need done differently.

5
nayeem
Re: isDirty and image
  • 2004/6/14 11:12

  • nayeem

  • Just popping in

  • Posts: 44

  • Since: 2004/1/3 1


XoopsTopic looks interesting. I might be able to extend and use it.

Do you know why no Handler class were used on this one? Most classes dealing with databases seems to use a handler class. Just wondering if there was a specific reason or the developer missed it out (which I would think is quite unlikely!)


6
Mithrandir
Re: isDirty and image

Honest answer: I don't know.

Perhaps because the XoopsTopic class IS the handler... I guess some methods could be moved to a XoopsTopicHandler class, but the idea is to start with a topic (or at the very top) and go from there to find child topics.

Some old code is in there as well - if you look carefully you'll see a property called use_permissions, which is used in the store() method... but it uses a class called XoopsPerms which does not exist (anymore)
Seems to be a leftover from earlier versions

Login

Who's Online

843 user(s) are online (65 user(s) are browsing Support Forums)


Members: 0


Guests: 843


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits