public function parse($data) { $this->databaseData = $data; while ($row = mysql_fetch_array($this->databaseData)) { $object = new CategoryVO($row[0]); $object->title($row['title']); $object->description($row['description']); if ($row['isPrivate'] == 'true') { $object->isPrivate(true); } else { if ($row['isPrivate'] == 'false') { $object->isPrivate(false); } else { $object->isPrivate(true); } } array_push($this->parsedData, $object); } return array_reverse($this->parsedData); }