When I try and run the code below I get the following error:
Error...
18-Sep-2018 14:18:44 UTC] PHP Fatal error: Uncaught Error: Call to undefined method CheckoutList::dataSource() in /Applications/MAMP/bin/phpMyAdmin/examples/MyExamples/AutolibCloudFullSystem/librarian/Reports/CheckoutList/checkoutList.php:29 Stack trace: #0 /Applications/MAMP/bin/phpMyAdmin/examples/MyExamples/AutolibCloudFullSystem/librarian/Reports/koolreport/KoolReport.php(39): CheckoutList->setup() #1 /Applications/MAMP/bin/phpMyAdmin/examples/MyExamples/AutolibCloudFullSystem/librarian/reports/checkoutlist/index.php(3): koolreport\KoolReport->__construct() #2 {main} thrown in /Applications/MAMP/bin/phpMyAdmin/examples/MyExamples/AutolibCloudFullSystem/librarian/Reports/CheckoutList/checkoutList.php on line 29
This is line 29 causing the error: $join->pipe($this->dataSource("together"));
//Code... //***
require_once "../koolreport/autoload.php"; use \koolreport\processes\Join; class CheckoutList extends \koolreport\KoolReport {
function settings()
{
return array(
"dataSources"=>array(
"mydata"=>array(
'connectionString' => 'mysql:host=localhost;dbname=MYSQL..........',
'username' => 'root',
'password' => 'root',
'charset' => 'utf8',
)
)
);
}
function setup()
{
// $this->src("mydata")
// ->query("select * from eloans")
// ->pipe($this->dataStore("eloans"));
$people_source = $this->src("mydata")->query("select BORRONUM,LastName,FirstName from people");
$eloans_source = $this->src("mydata")->query("select borroid,bookid,loandate from eloans");
$join = new Join($people_source,$eloans_source,array("BORRONUM"=>"borroid"));
$join->pipe($this->dataSource("together"));
}
}
/* reference
public function setup()
{
$user_source = $this->src('user_source')->query("select id,name from users");
$purchase_source = $this->src('purchase_source')->query("select user_id,item,amount from purchases");
//Note that: user_source and purchase_source can be from different database
$join = new Join($user_source,$purchase_source,array("id"=>"user_id"));
$join->pipe($this->dataSource('together'));
}
*/