当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Amf_Parse_TypeLoader::setMapping方法代码示例

本文整理汇总了PHP中Zend_Amf_Parse_TypeLoader::setMapping方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Amf_Parse_TypeLoader::setMapping方法的具体用法?PHP Zend_Amf_Parse_TypeLoader::setMapping怎么用?PHP Zend_Amf_Parse_TypeLoader::setMapping使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Amf_Parse_TypeLoader的用法示例。


在下文中一共展示了Zend_Amf_Parse_TypeLoader::setMapping方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setClassMap

 /**
  * Map ActionScript classes to PHP classes
  *
  * @param  string $asClass
  * @param  string $phpClass
  * @return Zend_Amf_Server
  */
 public function setClassMap($asClass, $phpClass)
 {
     require_once 'Zend/Amf/Parse/TypeLoader.php';
     Zend_Amf_Parse_TypeLoader::setMapping($asClass, $phpClass);
     return $this;
 }
开发者ID:raffpaquin,项目名称:Gregory,代码行数:13,代码来源:Server.php

示例2: testPhpObjectSerializedToAmf0TypedObjectClassMap

 public function testPhpObjectSerializedToAmf0TypedObjectClassMap()
 {
     Zend_Amf_Parse_TypeLoader::setMapping("ContactVO", "Contact");
     $data = array();
     $contact = new Contact();
     $contact->id = '15';
     $contact->firstname = 'Joe';
     $contact->lastname = 'Smith';
     $contact->email = 'jsmith@adobe.com';
     $contact->mobile = '123-456-7890';
     unset($contact->_explicitType);
     array_push($data, $contact);
     $contact = new Contact();
     $contact->id = '23';
     $contact->firstname = 'Adobe';
     $contact->lastname = 'Flex';
     $contact->email = 'was@here.com';
     $contact->mobile = '123-456-7890';
     unset($contact->_explicitType);
     array_push($data, $contact);
     $newBody = new Zend_Amf_Value_MessageBody('/1/onResult', null, $data);
     $this->_response->setObjectEncoding(0x0);
     $this->_response->addAmfBody($newBody);
     $this->_response->finalize();
     $testResponse = $this->_response->getResponse();
     // Load the expected response.
     $mockResponse = file_get_contents(dirname(__FILE__) . '/Response/mock/typedObjectAmf0Response.bin');
     // Check that the response matches the expected serialized value
     $this->assertEquals($mockResponse, $testResponse);
 }
开发者ID:travisj,项目名称:zf,代码行数:30,代码来源:ResponseTest.php

示例3: testSetMappingClass

 /**
  * Test that adding our own mappping will result in it being added to the classMap
  *
  */
 public function testSetMappingClass()
 {
     Zend_Amf_Parse_TypeLoader::setMapping('com.example.vo.Contact', 'Contact');
     $class = Zend_Amf_Parse_TypeLoader::getMappedClassName('com.example.vo.Contact');
     $this->assertEquals('Contact', $class);
 }
开发者ID:travisj,项目名称:zf,代码行数:10,代码来源:TypeLoaderTest.php

示例4: testAmf0TypedObjecDeserializedToNativePHPObject

 public function testAmf0TypedObjecDeserializedToNativePHPObject()
 {
     Zend_Amf_Parse_TypeLoader::setMapping("ContactVO", "Contact");
     $myRequest = file_get_contents(dirname(__FILE__) . '/Request/mock/typedObjectAmf0Request.bin');
     // send the mock object request to be deserialized
     $this->_request->initialize($myRequest);
     // Make sure that no headers where recieved
     $this->assertEquals(0, sizeof($this->_request->getAmfHeaders()));
     // Make sure that the message body was set after deserialization
     $this->assertEquals(1, sizeof($this->_request->getAmfBodies()));
     $bodies = $this->_request->getAmfBodies();
     $this->assertTrue($bodies[0] instanceof Zend_Amf_Value_MessageBody);
     $data = $bodies[0]->getData();
     // Make sure that we are dealing with a PHP simpleXml element
     $this->assertTrue($data[0] instanceof Contact);
     // Make sure that the xml was deserialized properly and check its value
     $this->assertEquals('arnold', (string) $data[0]->lastname);
 }
开发者ID:omusico,项目名称:logica,代码行数:18,代码来源:RequestTest.php

示例5: setClassMap

 /**
  * Map ActionScript classes to PHP classes
  *
  * @param  string $asClass
  * @param  string $phpClass
  * @return Zend_Amf_Server
  */
 public function setClassMap($asClass, $phpClass)
 {
     Zend_Amf_Parse_TypeLoader::setMapping($asClass, $phpClass);
     return $this;
 }
开发者ID:NerdGZ,项目名称:icingaweb2,代码行数:12,代码来源:Server.php


注:本文中的Zend_Amf_Parse_TypeLoader::setMapping方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。