My favorites | Sign in
Project Home Downloads Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
XMLUtils  

#phorm/utils/XMLUtils.php

Introduction

Static methods responsible for converting ArrayCollections of IDatabaseRecord objects into XML.

Public Static Methods

Method NameArgumentsReturns
recordInformation(string) $column, (string) $valueXML
collectionToXMLArrayCollection $collection, (int) $levels=null XML

Examples

Generate XML for 5 Articles

include_once $_SERVER['DOCUMENT_ROOT'].'/model.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/phorm/utils/XMLUtils.php';

$obj = new Articles();
$obj->limit = 5;
$arrayCollection = $obj->records();

XMLUtils::collectionToXML($arrayCollection);

Generate XML for 5 Articles do not follow ForeignKey's or ManyToMany Relationships by specifying the number of levels.

include_once $_SERVER['DOCUMENT_ROOT'].'/model.php';
include_once $_SERVER['DOCUMENT_ROOT'].'/phorm/utils/XMLUtils.php';

$obj = new Articles();
$obj->limit = 5;
$arrayCollection = $obj->records();

XMLUtils::collectionToXML($arrayCollection, 1);

Powered by Google Project Hosting