:SqlManager */ protected $sqlManager; /** * Variable for the serialazarion manager of the api * @var :SqlManager */ protected $serialManager; protected static $contentypeXML = "application/xml;charset=utf-8"; protected static $contentypeJson = "application/json;charset=utf-8"; /** * Default-Constructor */ public function __construct($headers = array()) { $this->connect(); parent::__construct(); // set content type td xml if ($headers && preg_match('/json/', $headers["Accept"])) { $this->serialManager = new \utiliy\JsonManager(); $this->contentType(self::$contentypeJson); } else { $this->serialManager = new \utiliy\XmlManager(); $this->contentType(self::$contentypeXML); } } /** * Default-DeConstructor */ public function __destruct() { // destroy the sqlManager $this->sqlManager->closeConnection(); unset($this->sqlManager); unset($this->serialManager); } /** * Method start a connection to the database */ public function connect() { $this->sqlManager->connect(); } } ?>