I am using a lightweight PHP MVC (homegrown--not by me--but based off of Codeigniter) to develop a web application. Currently, I only have one object--the User.
The web application allows each user to curate a collection (let's say the user has a collection of different animals) and manipulate the collection on the fly. One page in the site will define the set of animals' behaviors and the other will specify appearance. If the user deletes an animal while defining behavior, however, that animal should be removed from the collection once the user moves to the appearance tab.
Could (should) each animal be an Object? I know in Java I could pass an array of objects to a another Object in my application, but am not sure if this is possible/common in PHP (this would be the ideal implementation).
Alternatively, if I were to store all of the animals in some sort of data structure, could I pass that data structure between views (from the client side via AJAX?)
I don't want to store this information in a database because then, between each page load I would have to query the database anew to see if any changes had been made.