Skip to content

Instantly share code, notes, and snippets.

@dannewns
Created November 19, 2014 12:46

Revisions

  1. dannewns created this gist Nov 19, 2014.
    71 changes: 71 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,71 @@
    Route::get('{something}/csv', ['uses' => 'SomeController@getCSV', 'as' => 'csv.get']);

    SomeController {


    public function getCSV($something)
    {

    $csv = $this->csv_repository->find($something);

    }


    CsvRepository Implements CsvRepositoryInterface {

    public function __construct(\Client\CSV\Standard $standard,
    \Client\CSV\Wokingham $wokingham,
    \Client\CSV\Flagship $flagship,
    \Client\CSV\Keystone $keystone
    )
    {

    $this->standard = $standard;

    $this->wokingham = $wokingham;

    $this->flagship = $flagship;

    $this->keystone = $keystone;

    }


    switch($value) {
    case '161': // Wokingham
    return $this->wokingham->find($value);
    break;

    case '81': // Friendship Care and Housing
    case '267': // Worcester Community Housing
    case '38': // Clwyd Alyn Housing Association
    case '172': // Spire Homes
    case '205': // Two Rivers Housing
    case '128': // South Shropshire Housing Association (http://isite.dmwsafety.co.uk/client?q=shropshire ??)
    case '82': // Festival Housing
    case '273': // Herefordshire Housing
    case '214': // Beechdale Community Housing
    case '132': // Soha Housing Ltd
    case '130': // Solihull Community Housing
    case '170': // Orbit Heart Of England
    case '171': // Orbit South & East (http://isite.dmwsafety.co.uk/client?q=Orbit ??)
    return $this->flagship->find($value);
    break;

    case '175': // Sanctuary Housing
    case '168': // Lovell - Stroud
    case '180': // Lovell Respond
    case '215': // Glevum Heating
    case '210': // Mears Group Plc / Stroud
    return $this->keystone->find($value);
    break;

    case '177': // Wolverhampton Homes
    case '277': // Wates
    case '169': // Bullock
    default:
    return $this->standard->find($value);
    break;
    }
    });
    }