moving data conversion for xml from Model::set() to RequestHandler::startup();

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@4277 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
gwoo 2007-01-10 21:20:06 +00:00
parent 7019ee7d26
commit 790689fc32
2 changed files with 6 additions and 5 deletions

View file

@ -218,7 +218,12 @@ class RequestHandlerComponent extends Object {
if (!class_exists('xmlnode') && !class_exists('XMLNode')) {
uses('xml');
}
$controller->data = new XML(trim(file_get_contents('php://input')));
$xml = new XML(trim(file_get_contents('php://input')));
if (is_object($xml->child('data')) && count($xml->children) == 1) {
$controller->data = $xml->child('data');
} else {
$controller->data = $xml;
}
}
}
/**

View file

@ -727,10 +727,6 @@ class Model extends Overloadable {
if (is_object($one->child(Inflector::underscore($this->name)))) {
$one = $one->child(Inflector::underscore($this->name));
$one = $one->attributes;
} else if (is_object($one->child('data'))) {
$one = $one->child('data');
$one = $one->child(Inflector::underscore($this->name));
$one = $one->attributes;
} else {
return null;
}