douye7033 2013-05-30 08:40
浏览 70
已采纳

OOP与PHP(Web服务)

I am familiary with OOP in Java or .Net world, now I'm asked to work with OOP same in PHP in my company, but it seems total different, since in PHP we don't have strong type variables and I never did any OOP before in PHP. The task was actually to integrate an API(Qlikview) written in .NET and to do the same functionalities in PHP like in that API. Documentation can be found: http://community.qlikview.com/docs/DOC-2606

And to connect to the services, I create a new class which will be connected to ('http://:4799/QMS'). So far everything is working. But I've got an issue in changing the properties in my QMS. The QMS is installed on the server itself.

Let's say, I've following code:

List<DocumentFolder> DocFolders = BackendClient.GetUserDocumentFolders(QvsGuid, DocumentFolderScope.All);

I would write it actually like in buttom code in order to get those information that I require(QvsGuid and DocumentFolderScope.All):

$DocFolders=(object)array();
$DocFolders=$this->client->GetUserDocumentFolders(array('qvsID' => getQlikviewServerInfo()->ServiceInfo->ID, 'scope' => 'General'))->GetUserDocumentFoldersResult->DocumentFolder;

But on execution, I get:

 Call to a member function GetUserDocumentFolders() on a non-object

So I thought, I might have to create a class for $DocFolders of type DocumentFolder.

I know it might be only a focused group of people that might reply concerning the API, but I hope someone could open a new road of perspective.

  • 写回答

1条回答 默认 最新

  • dongtiao2066 2013-05-30 08:45
    关注

    Call to a member function GetUserDocumentFolders() on a non-object

    That error means that $this->client is not an object, more than likely its null and has not been set yet.

    You have to set $this->client to an instance of whatever class has the GetUserDocumentFolders function

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 linux驱动,linux应用,多线程
  • ¥20 我要一个分身加定位两个功能的安卓app
  • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
  • ¥15 IAR程序莫名变量多重定义
  • ¥15 (标签-UDP|关键词-client)
  • ¥15 关于库卡officelite无法与虚拟机通讯的问题
  • ¥15 目标检测项目无法读取视频
  • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
  • ¥100 求采集电商背景音乐的方法
  • ¥15 数学建模竞赛求指导帮助