public function __construct($symb, $portfolio) { // setup the the parent class (db connection etc) $workingDate = $portfolio->getWorkingDate(); $exch = $portfolio->exch->getID(); $pfid = $portfolio->getID(); $this->pfid = $pfid; parent::__construct($symb, $exch, $workingDate); // load the info from the stocks table $query = "select * from holdings where symb = '{$symb}' and pfid = '{$pfid}';"; try { $result = $this->dbh->query($query); } catch (PDOException $e) { tr_warn('holding:__construct:' . $query . ':' . $e->getMessage()); die("[FATAL]Class: holding, function: __construct\n"); } $row = $result->fetch(PDO::FETCH_ASSOC); if (isset($row['symb']) and $row['symb'] == $symb) { $this->hid = $row['hid']; $this->pfid = $row['pfid']; $this->openDate = $row['date']; $this->price = $row['price']; $this->qty = $row['volume']; $this->comment = $row['comment']; } }