config = $config; $this->dsn = $dsn; $this->user = $user; $this->password = $password; } public function getDatabaseDsn() { return $this->dsn; } public function getDbUser() { return $this->user; } public function getDbPassword() { return $this->password; } public function getNameLogin() { return $this->config[self::COLUMN_LOGIN_NAME]; } public function getNamePassword() { return $this->config[self::COLUMN_PASSWORD_NAME]; } public function getRequestScope() { $scope = ''; foreach ($this->config[self::DATA_TO_FETCH] as $data) { $scope .= $data.','; } $scope = substr($scope, 0, -1); $request = 'SELECT '.$scope.' FROM '.$this->config[self::TABLE_NAME].' WHERE '.$this->config[self::COLUMN_LOGIN_NAME].' = :'.$this->config[self::COLUMN_LOGIN_NAME].';'; return $request; } public function getRequestLogin() { return 'SELECT '.$this->config[self::COLUMN_PASSWORD_NAME].' FROM '.$this->config[self::TABLE_NAME].' WHERE '.$this->config[self::COLUMN_LOGIN_NAME].' = :'.$this->config[self::COLUMN_LOGIN_NAME].';'; } }