I got a bunch of classes and I want to send data from one class to another. But I am not able to achieve this. Hope you can help me with a solution for this.
I want to send data from this:
Report.php I have included the other file in the top of the file
include('DataReader.php');
public function __construct(){
$this->pageId = $_POST['pages'];
$this->since = strtotime($_POST['sincedate']);
$this->until = strtotime($_POST['untildate']);
echo "Report: " . $this->pageId . "<br>";
$this->dataReader = new DataReader();
$this->dataReader->setPageId($this->pageId);
}
Then i want the data inside the DateReader, but i get nothing? Notice i try to echo it to see if it recieves the data:
DataReader.php
class DataReader {
private $pageId;
public $since;
public $until;
public $accessToken;
public $fb;
/**
* @var FacebookRest
*/
private $facebook;
// Start app with app details from facebook
public function __construct() {
echo "DataReader: " . $this->pageId . "<br>";
$this->facebook = FacebookRest::getInstance();
$this->facebook->setPageId($this->pageId);
$this->facebook->setSince($this->since);
$this->facebook->setUntil($this->until);
}
public function setPageId($pageId) {
$this->pageId = $pageId;
echo $this->pageId;
}
}
Hope you cant help me getting data from Report.php into DataReader.pgp.