public final function getView($id, $view, & $properties_cache = null, & $view_cache = null, & $persistent_view_cache = null)
	{
		// Check cache
		if (isset($view_cache[$view])) {
			return $view_cache[$view];
		}

		switch ($view) {
			case 'url':
				// Get URL of this state machine
				return $this->urlFormat($id, $this->url_fmt, $properties_cache);
			case 'parent_url':
				// Get URL of parent state machine or collection or whatever it is
				if ($this->parent_url_fmt !== null) {
					return $this->urlFormat($id, $this->parent_url_fmt, $properties_cache);
				} else {
					return null;
				}
			case 'post_action_url':
				// Get URL of redirect-after-post
				return $this->urlFormat($id, $this->post_action_url_fmt !== null ? $this->post_action_url_fmt : $this->url_fmt, $properties_cache);
			default:
				// Check references
				if (isset($this->references[$view])) {
					// Populate properties cache if empty
					if ($properties_cache === null) {
						$properties_cache = $this->getProperties($id);
					}

					// Create reference & cache it
					return ($view_cache[$view] = $this->resolveMachineReference($view, $properties_cache));
				} else {
					return ($view_cache[$view] = $this->calculateViewValue($id, $view, $properties_cache, $view_cache, $persistent_view_cache));
				}
		}
	}
public final function getView($id, $view, & $properties_cache = null, & $view_cache = null, & $persistent_view_cache = null)
	{
		// Check cache
		if (isset($view_cache[$view])) {
			return $view_cache[$view];
		}

		switch ($view) {
			case 'url':
				// Get URL of this state machine
				return $this->urlFormat($id, $this->url_fmt, $properties_cache);
			case 'parent_url':
				// Get URL of parent state machine or collection or whatever it is
				if ($this->parent_url_fmt !== null) {
					return $this->urlFormat($id, $this->parent_url_fmt, $properties_cache);
				} else {
					return null;
				}
			case 'post_action_url':
				// Get URL of redirect-after-post
				return $this->urlFormat($id, $this->post_action_url_fmt !== null ? $this->post_action_url_fmt : $this->url_fmt, $properties_cache);
			default:
				// Check references
				if (isset($this->references[$view])) {
					// Populate properties cache if empty
					if ($properties_cache === null) {
						$properties_cache = $this->getProperties($id);
					}

					// Create reference & cache it
					return ($view_cache[$view] = $this->resolveMachineReference($view, $properties_cache));
				} else {
					return ($view_cache[$view] = $this->calculateViewValue($id, $view, $properties_cache, $view_cache, $persistent_view_cache));
				}
		}
	}
public final function getView ( $ id , $ view , & $ properties_cache = null , & $ view_cache = null , & $ persistent_view_cache = null ) { // Check cache if ( isset ( $ view_cache [ $ view ] ) ) { return $ view_cache [ $ view ] ; } switch ( $ view ) { case 'url' : // Get URL of this state machine return $ this -> urlFormat ( $ id , $ this -> url_fmt , $ properties_cache ) ; case 'parent_url' : // Get URL of parent state machine or collection or whatever it is if ( $ this -> parent_url_fmt !== null ) { return $ this -> urlFormat ( $ id , $ this -> parent_url_fmt , $ properties_cache ) ; } else { return null ; } case 'post_action_url' : // Get URL of redirect-after-post return $ this -> urlFormat ( $ id , $ this -> post_action_url_fmt !== null ? $ this -> post_action_url_fmt : $ this -> url_fmt , $ properties_cache ) ; default : // Check references if ( isset ( $ this -> references [ $ view ] ) ) { // Populate properties cache if empty if ( $ properties_cache === null ) { $ properties_cache = $ this -> getProperties ( $ id ) ; } // Create reference & cache it return ( $ view_cache [ $ view ] = $ this -> resolveMachineReference ( $ view , $ properties_cache ) ) ; } else { return ( $ view_cache [ $ view ] = $ this -> calculateViewValue ( $ id , $ view , $ properties_cache , $ view_cache , $ persistent_view_cache ) ) ; } } }
Get properties in given view.

Just like SQL view, the property view is transformed set of
properties. These views are useful when some properties require
heavy calculations.

Keep in mind, that view name must not interfere with Reference
properties, otherwise the view is inaccessible directly.

Array $properties_cache is supplied by Reference class to make some
calculations faster and without duplicate database queries.
Make sure these cached properties are up to date or null.

Array $view_cache is writable cache inside the Reference class,
flushed together with $properties_cache. If cache is empty, but
available, an empty array is supplied.

Array $persistent_view_cache is kept untouched for entire Reference
lifetime. If cache is empty, but available, an empty array is
supplied.

@see AbstractMachine::calculateViewValue()
Get properties in given view .