/** * Class constructor. * * @param string $key Consumer key * @param DataConnector $dataConnector A data connector object * @param boolean $autoEnable true if the tool consumers is to be enabled automatically (optional, default is false) */ public function __construct($key = null, $dataConnector = null, $autoEnable = false) { $this->initialize(); if (empty($dataConnector)) { $dataConnector = DataConnector::getDataConnector(); } $this->dataConnector = $dataConnector; if (!empty($key)) { $this->load($key, $autoEnable); } else { $this->secret = DataConnector::getRandomString(32); } }