public static function getDataApi() { $obj = new Mailjet(); if (self::$data_api === null) { self::$data_api = mailjetdata::getInstance(); self::$data_api->setKeys($obj->getAccountSettingsKey('API_KEY'), $obj->getAccountSettingsKey('SECRET_KEY')); } return self::$data_api; }
/** * Singleton pattern : * Get the instance of the object if it already exists * or create a new one. * * @access public * @uses MailjetData::$_instance * * @return resource instance */ public static function getInstance() { if (!self::$_instance instanceof self) { self::$_instance = new self(); } return self::$_instance; }