Skip to content

Commit

Permalink
Reflect the changes to the Cake PHP 3.6 api in the readme
Browse files Browse the repository at this point in the history
  • Loading branch information
David Yell committed Jun 4, 2018
1 parent 5ddab56 commit a7074e8
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ class Articles extends AbstractDriver
{

/**
* {@inheritDoc}
* Initialize is used to easily extend the constructor.
*/
public function initialize()
{
$this->client(new Client([
$this->setClient(new Client([
'host' => 'example.com'
]));
}
Expand All @@ -63,7 +63,6 @@ class Articles extends AbstractDriver

namespace App\Webservice;

use Cake\Network\Http\Client;
use Muffin\Webservice\Query;
use Muffin\Webservice\ResultSet;
use Muffin\Webservice\Webservice\Webservice;
Expand All @@ -72,11 +71,11 @@ class ArticlesWebservice extends Webservice
{

/**
* {@inheritDoc}
* Executes a query with the read action using the Cake HTTP Client
*/
protected function _executeReadQuery(Query $query, array $options = [])
{
$response = $this->driver()->client()->get('/articles.json');
$response = $this->getDriver()->getClient()->get('/articles.json');

if (!$response->isOk()) {
return false;
Expand Down Expand Up @@ -127,18 +126,19 @@ class Article extends Resource
namespace App\Controller;

use Cake\Event\Event;
use Muffin\Webservice\Model\EndpointLocator;

class ArticlesController extends AppController
{
public function initialize()
{
// You can also put this in AppController::initialize() itself
$this->modelFactory('Endpoint', ['Muffin\Webservice\Model\EndpointRegistry', 'get']);
$this->EndpointLocator = new EndpointLocator();
}

public function beforeFilter(Event $event)
{
$this->loadModel('Articles', 'Endpoint');
$this->EndpointLocator->get('Articles');
}

public function index()
Expand Down

0 comments on commit a7074e8

Please sign in to comment.