public static function arrayToJSON(array $entities, $depth=0) {
		foreach($entities as $k=>$entity)
			$entities[$k] = $entity->toArray($depth);
		return json_encode($entities);
	}
public static function arrayToJSON(array $entities, $depth=0) {
		foreach($entities as $k=>$entity)
			$entities[$k] = $entity->toArray($depth);
		return json_encode($entities);
	}
public static function arrayToJSON ( array $ entities , $ depth = 0 ) { foreach ( $ entities as $ k => $ entity ) $ entities [ $ k ] = $ entity -> toArray ( $ depth ) ; return json_encode ( $ entities ) ; }
Convert an array of entities to json.
@param  Entity[]  $entities
@param  integer   $depth
@return string
Convert an array of entities to json .