Php 配置flex的推进返回类型
我使用wamp服务器和Propel。我已经使用Propel编写了我的服务,但是当我想要连接从service Flex返回的数据时,我无法识别返回类型 这是我写的php代码Php 配置flex的推进返回类型,php,apache-flex,propel,Php,Apache Flex,Propel,我使用wamp服务器和Propel。我已经使用Propel编写了我的服务,但是当我想要连接从service Flex返回的数据时,我无法识别返回类型 这是我写的php代码 <?php // Include the main Propel script require_once 'C:/wamp/propel/runtime/lib/Propel.php'; // Initialize Propel with the runtime configuration Propel::init
<?php
// Include the main Propel script
require_once 'C:/wamp/propel/runtime/lib/Propel.php';
// Initialize Propel with the runtime configuration
Propel::init("C:/wamp/www/school/build/conf/school-conf.php");
// Add the generated 'classes' directory to the include path
set_include_path("C:/wamp/www/school/build/classes" . PATH_SEPARATOR . get_include_path());
class TeacherService {
function getTeachers()
{
$allTeachers=TeacherQuery::create()->find();
$teachers=array();
foreach($allTeachers as $teacher1)
{
array_push($teachers, $teacher1);
}
return $teachers;
}
}
?>
我如何让flex知道propel返回的教师行的属性?@www.Flextras.com
spreep是一个PHP-ORM框架
如果您希望序列化在php类上工作,那么您必须有如下内容
var $_explicitType = "path.to.classes.Teacher";
在你的柔性侧VO上,你必须有这样的东西
[Bindable]
[RemoteClass(alias="path.to.classes.Teacher")]
这是假设您正在使用AMF。另外,在AMF端点中,您必须指定映射,例如,我的端点文件中会有类似的内容
$server->setClassMap('path.to.classes.Teacher' , 'path\to\classes\Teacher');
这让您的端点知道,当它看到一个具有匹配描述符的类时,它应该反序列化到PHP端的哪个类。我添加了PHP标记b/c,您似乎只提供PHP代码。一、 就个人而言,我不知道推进是什么。
$server->setClassMap('path.to.classes.Teacher' , 'path\to\classes\Teacher');