<?php
function fn_orderprop_t($aql)
{
	$data = $aql->Consume(1);
		
	$dta = $data[0];
	
	if (count($dta->value) == 0)
	{
		$a = new AQLStackElement();
		$a->typename = "pointlist";
		$a->islist = true;
		$a->value = array();
		array_push($aql->stack,$a);
		return;
	}
		
	$hitlist = array();	
	$tosort = array();
	foreach($dta->value as $pnt)
	{
		//echo 'Writing '.$pnt->propertyid.'_'.$pnt->assetid;
		$tosort[$pnt->propertyid.'_'.$pnt->assetid] = $pnt;		
	}
	ksort($tosort);
	//print_r($tosort);
	foreach($tosort as $k => $v)
	{
		$hitlist[] = $v;
	}	
	
	//print_r($hitlist);
	
	$a = new AQLStackElement();
	$a->typename = "pointlist";
	$a->islist = true;
	$a->value = $hitlist;
	array_push($aql->stack,$a);

}
?>