find('Key', 'CurrentMemberID'); if(!$state) { $state = new TestSessionDatabaseState(array( 'Key' => 'CurrentMemberID' )); } $state->Value = $this->owner->ID; $state->write(); } public function memberLoggedOut() { if(!SapphireTest::using_temp_db()) return; $state = TestSessionDatabaseState::get()->filter('Key', 'CurrentMemberID')->removeAll(); } }