original_string: public static function find_revision($id, $timestamp = null, $relations = array())
  	{
  		if ($timestamp == null)
  		{
  			return parent::find($id);
  		}
  
  		$timestamp_start_name = static::temporal_property('start_column');
  		$timestamp_end_name = static::temporal_property('end_column');
  
  		// Select the next latest revision after the requested one then use that
  		// to get the revision before.
  		self::disable_primary_key_check();
  
  		$query = static::query()
  			->where('id', $id)
  			->where($timestamp_start_name, '<=', $timestamp)
  			->where($timestamp_end_name, '>', $timestamp);
  		self::enable_primary_key_check();
  
  		//Make sure the temporal stuff is activated
  		$query->set_temporal_properties($timestamp, $timestamp_end_name, $timestamp_start_name);
  
  		foreach ($relations as $relation)
  		{
  			$query->related($relation);
  		}
  
  		$query_result = $query->get_one();
  
  		// If the query did not return a result but null, then we cannot call
  		//  set_lazy_timestamp on it without throwing errors
  		if ( $query_result !== null )
  		{
  			$query_result->set_lazy_timestamp($timestamp);
  		}
  		return $query_result;
  	}
code: public static function find_revision($id, $timestamp = null, $relations = array())
  	{
  		if ($timestamp == null)
  		{
  			return parent::find($id);
  		}
  
  		$timestamp_start_name = static::temporal_property('start_column');
  		$timestamp_end_name = static::temporal_property('end_column');
  
  		// Select the next latest revision after the requested one then use that
  		// to get the revision before.
  		self::disable_primary_key_check();
  
  		$query = static::query()
  			->where('id', $id)
  			->where($timestamp_start_name, '<=', $timestamp)
  			->where($timestamp_end_name, '>', $timestamp);
  		self::enable_primary_key_check();
  
  		//Make sure the temporal stuff is activated
  		$query->set_temporal_properties($timestamp, $timestamp_end_name, $timestamp_start_name);
  
  		foreach ($relations as $relation)
  		{
  			$query->related($relation);
  		}
  
  		$query_result = $query->get_one();
  
  		// If the query did not return a result but null, then we cannot call
  		//  set_lazy_timestamp on it without throwing errors
  		if ( $query_result !== null )
  		{
  			$query_result->set_lazy_timestamp($timestamp);
  		}
  		return $query_result;
  	}
code_tokens: public static function find_revision ( $ id , $ timestamp = null , $ relations = array ( ) ) { if ( $ timestamp == null ) { return parent :: find ( $ id ) ; } $ timestamp_start_name = static :: temporal_property ( 'start_column' ) ; $ timestamp_end_name = static :: temporal_property ( 'end_column' ) ; // Select the next latest revision after the requested one then use that // to get the revision before. self :: disable_primary_key_check ( ) ; $ query = static :: query ( ) -> where ( 'id' , $ id ) -> where ( $ timestamp_start_name , '<=' , $ timestamp ) -> where ( $ timestamp_end_name , '>' , $ timestamp ) ; self :: enable_primary_key_check ( ) ; //Make sure the temporal stuff is activated $ query -> set_temporal_properties ( $ timestamp , $ timestamp_end_name , $ timestamp_start_name ) ; foreach ( $ relations as $ relation ) { $ query -> related ( $ relation ) ; } $ query_result = $ query -> get_one ( ) ; // If the query did not return a result but null, then we cannot call //  set_lazy_timestamp on it without throwing errors if ( $ query_result !== null ) { $ query_result -> set_lazy_timestamp ( $ timestamp ) ; } return $ query_result ; }
docstring: Finds a specific revision for the given ID. If a timestamp is specified
  the revision returned will reflect the entity's state at that given time.
  This will also load relations when requested.
  
  @param type $id
  @param int $timestamp Null to get the latest revision (Same as find($id))
  @param array $relations Names of the relations to load.
  @return Subclass of Orm\Model_Temporal
docstring_tokens: Finds a specific revision for the given ID . If a timestamp is specified the revision returned will reflect the entity s state at that given time . This will also load relations when requested .