public function ordenarNumeric($order) { $array = $this->toArray(); switch ($order) { case 1: sort($array, SORT_NUMERIC); break; case -1: rsort($array, SORT_NUMERIC); break; } $lista = new Lista(); $lista->fromArray($array); return $lista; }