Skip to content

Instantly share code, notes, and snippets.

@angelxmoreno
Created July 25, 2014 20:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save angelxmoreno/4f0a41d76a81108cffc5 to your computer and use it in GitHub Desktop.
Save angelxmoreno/4f0a41d76a81108cffc5 to your computer and use it in GitHub Desktop.
<?php
App::uses('ConnectionManager', 'Model');
$db = ConnectionManager::getDataSource('amazon');
$books = $db->find('Books', array(
'title' => 'Harry Potter'
));
debug($books);
@angelxmoreno
Copy link
Author

or more specifically in the controller

public function test(){
        $this->autoRender = false;
        App::uses('ConnectionManager', 'Model');
        $db = ConnectionManager::getDataSource('amazon');
        $response = $db->find('Books', array(
            'title' => 'Harry Potter'
        ));
        $books = $response['ItemSearchResponse']['Items']['Item'];
        debug($books);
    }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment