public function reformatResult($result)
    {
        $collection = new Collection($result);
        
        switch ($this->format) {
            case 'json':
                return $collection->toJson();
                break;

            case 'object':
               return json_decode(json_encode($collection->toArray()), false);
               break;

            default:
                return $collection->toArray();
                break;
        }
    }
public function reformatResult($result)
    {
        $collection = new Collection($result);
        
        switch ($this->format) {
            case 'json':
                return $collection->toJson();
                break;

            case 'object':
               return json_decode(json_encode($collection->toArray()), false);
               break;

            default:
                return $collection->toArray();
                break;
        }
    }
public function reformatResult ( $ result ) { $ collection = new Collection ( $ result ) ; switch ( $ this -> format ) { case 'json' : return $ collection -> toJson ( ) ; break ; case 'object' : return json_decode ( json_encode ( $ collection -> toArray ( ) ) , false ) ; break ; default : return $ collection -> toArray ( ) ; break ; } }
Reformat the result.

@param  object $result
@return mixed
Reformat the result .