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:----ozPyti69COHZv1pBz7vXH+QIFuKsDWDZSggXlYbU3g/QdNDfwkdnL2aJEM2t1ZWZnilVsV+WZd3CUGP03GnIpfcR+U5AlfrSR5W4zoyTpVOHWgk0Wts5RhCdEWyJIkPN8InAnN1Xn1HLU2m3XP+R0oUPLCKKTglUXZ7R5OA1+8lRgk7YB+6JVwDz4rGLXMS0ayV6QyBj3nOenb719wRxD34FaPnOpV4PZ7lURJG9oY0Eu6hbCN47WyXWEL861qi/GBXXvis2o951GohiG57B3rYb9K8VDqcIno52+kJ9Px6T1dYT/vAWBfs1GVZPpCts1cOuXEhmwCd3SLqVqYck90CGB60b/3f5j9fGSb4ZmOkiIe9ArPlnOf7blZPDmAiNuDe/pQMCXBtk6kQHdaorv/gATjESnLSL3kTtVQ5e8yIXBwgAbnKNMyzytmlqtUSuXJhv3ccEQavhkYgM7SNnelQKgIOG4IxWgIiWIBxsAWdc0eXes50K4Mzxw9dx80w6LTXhsI9o4FcrZBWqHuxIujFaHWt6M/uWD31aht0eaX0qGXTDJZ981sdNrk60wYAjTeqeh1MTzfe+8Fbo+WOXyiloR5zAQynsSWQ809aJ64V35vTRHn0GQ4CIUMb9W5Ekg7H82WYAnxTVXVQB+0Rx6TOlSsC61ww0daDgChmjZx0=----ATTACHMENT:----NzEwODEyNTQ5MzIxOTEwMSA3OTE3MzY4NDgyNDcxNTkzIDkyMzIwNTc4NDQ5NzUzOTU=