/** * * * @return void */ public function appendData(MData $data) { $this->bytes .= $data->getBytes(); }
/** * * * @return MData */ public function dataByAppendingData(MData $data) { return new MData($this->getBytes() . $data->getBytes()); }
/** * Parses one or more Managed Objects from inside the specified XML data * and inserts them into this Managed Object Context * * @param MData $data A data object containing the XML representation of the objects to be parsed * @param callable $callback A callback function which will be called every time a new * object is parsed and added into the Managed Object Context. The method signature for the * callback is callback(MManagedObject $object); * * * @return MArray An Array containing the parsed objects */ public function parseObjectsFromData(MData $data, callable $callback = null) { $xml = simplexml_load_string($data->getBytes()); return $this->parseObjectsFromXML($xml, $callback); }