original_string: public function restore()
  	{
  		$timestamp_end_name = static::temporal_property('end_column');
  		$max_timestamp = static::temporal_property('max_timestamp');
  
  		// check to see if there is a currently active row, if so then don't
  		// restore anything.
  		$activeRow = static::find('first', array(
  				'where' => array(
  					array('id', $this->id),
  					array($timestamp_end_name, $max_timestamp),
  				),
  			));
  
  		if(is_null($activeRow))
  		{
  			// No active row was found so we are ok to go and restore the this
  			// revision
  			$timestamp_start_name = static::temporal_property('start_column');
  			$mysql_timestamp = static::temporal_property('mysql_timestamp');
  
  			$max_timestamp = static::temporal_property('max_timestamp');
  			$current_timestamp = $mysql_timestamp ?
  				\Date::forge()->format('mysql') :
  				\Date::forge()->get_timestamp();
  
  			// Make sure this is saved as a new entry
  			$this->_is_new = true;
  
  			// Update timestamps
  			static::disable_primary_key_check();
  			$this->{$timestamp_start_name} = $current_timestamp;
  			$this->{$timestamp_end_name} = $max_timestamp;
  
  			// Save
  			$result = parent::save();
  			static::enable_primary_key_check();
  
  			return $result;
  		}
  
  		return false;
  	}
code: public function restore()
  	{
  		$timestamp_end_name = static::temporal_property('end_column');
  		$max_timestamp = static::temporal_property('max_timestamp');
  
  		// check to see if there is a currently active row, if so then don't
  		// restore anything.
  		$activeRow = static::find('first', array(
  				'where' => array(
  					array('id', $this->id),
  					array($timestamp_end_name, $max_timestamp),
  				),
  			));
  
  		if(is_null($activeRow))
  		{
  			// No active row was found so we are ok to go and restore the this
  			// revision
  			$timestamp_start_name = static::temporal_property('start_column');
  			$mysql_timestamp = static::temporal_property('mysql_timestamp');
  
  			$max_timestamp = static::temporal_property('max_timestamp');
  			$current_timestamp = $mysql_timestamp ?
  				\Date::forge()->format('mysql') :
  				\Date::forge()->get_timestamp();
  
  			// Make sure this is saved as a new entry
  			$this->_is_new = true;
  
  			// Update timestamps
  			static::disable_primary_key_check();
  			$this->{$timestamp_start_name} = $current_timestamp;
  			$this->{$timestamp_end_name} = $max_timestamp;
  
  			// Save
  			$result = parent::save();
  			static::enable_primary_key_check();
  
  			return $result;
  		}
  
  		return false;
  	}
code_tokens: public function restore ( ) { $ timestamp_end_name = static :: temporal_property ( 'end_column' ) ; $ max_timestamp = static :: temporal_property ( 'max_timestamp' ) ; // check to see if there is a currently active row, if so then don't // restore anything. $ activeRow = static :: find ( 'first' , array ( 'where' => array ( array ( 'id' , $ this -> id ) , array ( $ timestamp_end_name , $ max_timestamp ) , ) , ) ) ; if ( is_null ( $ activeRow ) ) { // No active row was found so we are ok to go and restore the this // revision $ timestamp_start_name = static :: temporal_property ( 'start_column' ) ; $ mysql_timestamp = static :: temporal_property ( 'mysql_timestamp' ) ; $ max_timestamp = static :: temporal_property ( 'max_timestamp' ) ; $ current_timestamp = $ mysql_timestamp ? \ Date :: forge ( ) -> format ( 'mysql' ) : \ Date :: forge ( ) -> get_timestamp ( ) ; // Make sure this is saved as a new entry $ this -> _is_new = true ; // Update timestamps static :: disable_primary_key_check ( ) ; $ this -> { $ timestamp_start_name } = $ current_timestamp ; $ this -> { $ timestamp_end_name } = $ max_timestamp ; // Save $ result = parent :: save ( ) ; static :: enable_primary_key_check ( ) ; return $ result ; } return false ; }
docstring: Restores the entity to this state.
  
  @return boolean
docstring_tokens: Restores the entity to this state .