Jump to content

Object Collection


Obi1-Cannabis

Recommended Posts

Hi,I am trying to make a class 'photos' wich will be like a collection of class 'photo'... now, i think there is no php function to create object collections... but if anyone have ever simulated it or has any idea about how to, please let me know.Thank you :)

Link to comment
Share on other sites

Store the photos in an array property inside the photos class. The array can dynamically resize according to how many elements you have in it. You can have methods on the photos class to add a new photo, check if one exists, return one, get the number of photos, delete one, etc. All the methods would just do various operations on the array.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...