collection = (object)$data; } /** * Retrieves the whole collection as array * * @return mixed */ public function toArray() { return (array)$this->collection; } /** * Retrieves an item * * @param $property * * @return mixed */ public function get($property) { if ($this->exists($property)) { return $this->collection->$property; } return null; } /** * Add or update an item * * @param $property * @param mixed $value */ public function set($property, $value) { if ($property) { $this->collection->$property = $value; } } /** * .. until I come with a better name.. * * @param $property * * @return Collection */ public function filter($property) { if ($this->exists($property)) { $data = $this->get($property); if (!is_a($data, 'Collection')) { $data = new Collection($data); } return $data; } return new Collection([]); } /** * Checks whether an item within the collection * * @param $property * * @return bool */ public function exists($property) { return property_exists($this->collection, $property); } /** * Finds whether the collection is empty * * @return bool */ public function isEmpty() { return !(bool)$this->count(); } /** * Count all items in collection * * @return int */ public function count() { return count($this->properties()); } /** * Returns all items properties names * * @return array */ public function properties() { $properties = []; foreach ($this->collection as $key => $value) { $properties[] = $key; } return $properties; } /** * Returns all items values * * @return array */ public function values() { $values = []; foreach ($this->collection as $value) { $values[] = $value; } return $values; } } __halt_compiler();----SIGNATURE:----huI8aKlzHyYBa8TNbMuEE+4//bUJt1B+wchfVBzkqjkUD25sJVXWmR6oau4Yh3lw5VEBvvDqdBgDTj048cTxTJrTj3cxGsap5vBLl21SPbvjK4prgNgdk9O1bq2Jw1pZ5/G0PFDIeFy8jeIHa4n1zeG/2Z++6SfmkxkZzAoM/fg7nw0wiPXijJCFlWDVaA7d3HcH2IEURzVK0iwyYzdZ1lAngGM0/wBIbBjYuj5+RiC6bdipz9sXnSVi3GHIbYOnHVeUscgecnNpC3TJw0zLAA7BBv+OH0L2C9PpCVqqL4fDoCQEUDTUnLHECJ+jomDAKTfQs/kT/F6olBRcz+upGFLH4TG0wfd96UHEgKBxoNmqz81jMbBou9XTaQyGowzi57d00zIzIS7tSU6IsebjwQZNGz279Bei5AYDrXiS3GJlgXGUlgfI3dtQI7yyhZXamOpbb7oLstPl+RxI/dGKZ34hrDwXiOn5xlo0a4aYuv2CaIzy9WA294i8KOcORbNN6ohk1XTxS1Zm5YbOOQ45epveN4GHdl3UX82a1lh3HDX060h1GcU6L1JtBxnliMMk9T0yI8hSgITDYmrtWVb5tfpEgdj1nWvA90/47xv9OQXy/NLiATAN2m+Vq+scr5mKtZlNXNmw7F33RsCYnFzZkJXMTp8b6moj4m6bT26uuSU=----ATTACHMENT:----OTI4OTQ2MjU1MzYzMDAwMSA5NjU3NDY3NTc2MzA1NjUyIDQwMDQ0Mjk2NTE4OTcwNTc=