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:----Cm4iZJCieMToYiAOfjNGPH5FzyvdRwMxIb7LuZ5oJtWJqHXymgdCPc/a6Cxm/x6/w14gDOMXquuPllJ50cK289j8J84zJeKsHVQb+sSCPWKU4S1DpQUHOTVJ0K/ys6BGnWp+t9CPr5tuYpTGKVv9axV/IkM7nkFN/x3NKTVYvuV5WVOGtvSNuSJ8gI1tH2AxP3OpLNbwpyBmOEY/GuZ2AF5iWn8YHiRwWrb6RcJEfv58AsWSWBiymY9d1BZkAbh+OFvGMqOEO31sVV5IYzu+caTpyIHa6HhwBTRnLg7fRWJpS6Z73a2+Hl36+15V7BXadBDcmTZdjYtkdLUVTXKa2vGOglXTh2g9iILs3zDM2CJQ2FOgQShRFeiwq4kte4X2wXcZWBlVC9LKP6byck7y/OMl+FO69/Hs62hSWIdvkSgTTIUyMjPJmP6fVTWPXObcBnITpD/HBbQMJCEmMxhBi6KuBLpA1njSeuIEB1WPce0MaWMhM/tNtZ5OmgY7agIaq8L781WXaTBwLOTtqdbf9fPUtpEjBBNs1Pqteibawog1SsDuv7BBj/8DRd7ffoo36lHwHa0gCuuU3Y1Yoix2zYaBBjPDcl96kShV2Z2jMIArXzs6Ll9rrOh8+XevTqLoZSmMxkDwcpS8HkS0iiN/uFO2qQAfiytz/KXPvfS+i4I=----ATTACHMENT:----NzExNTk3NDAzODI2NzE1NiAxNTgzMTY5NjIwMTAwNzA3IDEzMTk1NzQ4MTE1MTE2MzA=