/** * Converts the class into a legible array. * * @return array */ public function save() { return array('isSunk' => $this->isSunk, 'sunkShips' => $this->sunkShips, 'grid' => $this->grid, 'shipsGrid' => $this->shipsGrid->save()); }