protected function resolveMachineReference(string $reference_name, array $properties_cache): Reference
	{
		if (!isset($this->references[$reference_name])) {
			throw new \InvalidArgumentException('Unknown reference: '.$reference_name);
		}

		// Get reference configuration
		$r = $this->references[$reference_name];

		// Get referenced machine id
		$ref_machine_id = array();
		foreach ($r['machine_id'] as $mid_prop) {
			$ref_machine_id[] = $properties_cache[$mid_prop];
		}

		// Get referenced machine type
		$ref_machine_type = $r['machine_type'];

		return $this->smalldb->getMachine($ref_machine_type)->ref($ref_machine_id);
	}
protected function resolveMachineReference(string $reference_name, array $properties_cache): Reference
	{
		if (!isset($this->references[$reference_name])) {
			throw new \InvalidArgumentException('Unknown reference: '.$reference_name);
		}

		// Get reference configuration
		$r = $this->references[$reference_name];

		// Get referenced machine id
		$ref_machine_id = array();
		foreach ($r['machine_id'] as $mid_prop) {
			$ref_machine_id[] = $properties_cache[$mid_prop];
		}

		// Get referenced machine type
		$ref_machine_type = $r['machine_type'];

		return $this->smalldb->getMachine($ref_machine_type)->ref($ref_machine_id);
	}
protected function resolveMachineReference ( string $ reference_name , array $ properties_cache ) : Reference { if ( ! isset ( $ this -> references [ $ reference_name ] ) ) { throw new \ InvalidArgumentException ( 'Unknown reference: ' . $ reference_name ) ; } // Get reference configuration $ r = $ this -> references [ $ reference_name ] ; // Get referenced machine id $ ref_machine_id = array ( ) ; foreach ( $ r [ 'machine_id' ] as $ mid_prop ) { $ ref_machine_id [ ] = $ properties_cache [ $ mid_prop ] ; } // Get referenced machine type $ ref_machine_type = $ r [ 'machine_type' ] ; return $ this -> smalldb -> getMachine ( $ ref_machine_type ) -> ref ( $ ref_machine_id ) ; }
Helper function to resolve reference to another machine.

@param string $reference_name    Name of the reference in AbstractMachine::references.
@param array  $properties_cache  Properties of referencing machine.
@return Reference to referred machine.
Helper function to resolve reference to another machine .