<?php

require_once 'ViewTypeMaximumIndexes.class.php';

class User_ViewTypeMaximumItems extends User_ViewTypeMaximumIndexes {

	/**
	 *
	 * get registry view
	 *
	 * @param object $field
	 * @return array
	 */
	public function getRegistryView($field) {
		$result = array();
		XCube_DelegateUtils::call('Module.User.GetUserMaximumResources', new XCube_Ref($result), null);
		
		if (count($result) > 0) {
			foreach ($result as $limit) {
				$default = $limit['itemNumberLimit'];
			}
		} else {
			$default = $field->getDefault();
		}
		return $this->getInputView($field, $default, 1);
	}	
}

