Clears the current object, sets all attributes to their default values and removes
outgoing references as well as back-references (from other objects to this one. Results probably in a database
change of those foreign objects when you call `save` there).
185343
public function clear()
    {
        $this->id = null;
        $this->username = null;
        $this->password = null;
        $this->first_name = null;
        $this->last_name = null;
        $this->create_date = null;
        $this->update_date = null;
        $this->status = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
90216
public function clear()
    {
        if (null !== $this->aMedia) {
            $this->aMedia->removeM2P($this);
        }
        if (null !== $this->aPage) {
            $this->aPage->removeM2P($this);
        }
        $this->media_id = null;
        $this->page_id = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
409572
public function clear()
    {
        $this->id = null;
        $this->code = null;
        $this->driver_code = null;
        $this->title = null;
        $this->serialized_configuration = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
402975
public void clear() {
		// clear properties
		List<String> ownProps = getOwnProperties();
		
		for (String key : properties.keySet().toArray(new String[]{})) {
			if (ownProps.contains(key)) {
				Object value = properties.get(key);
				if (value instanceof JsonCollection) {
					JsonCollection entity = (JsonCollection)value;
					entity.clear();
				} else {
					remove(key);	
				}
			} else {
				remove(key);
			}
		}
		
		// clear fields
		for (Field field : getFields(this.getClass())) {
			if (field != null && JsonCollection.class.isAssignableFrom(field.getType())) {
				try {
					field.setAccessible(true);
					JsonCollection entity = (JsonCollection) field.get(this);
					entity.clear();
				} catch (Exception e) {
					log.error(e);
				}
			}
		}
		
		// clear sort order
		sortOrder.clear();
	}
717482
public void clear()
    {
        // clear out ref queue. We don't need to expunge entries
        // since table is getting cleared.
        emptySoftQueue();

        Entry tab[] = table;
        for (int i = 0; i < tab.length; ++i)
            tab[i] = null;
        size = 0;

        // Allocation of array may have caused GC, which may have caused
        // additional entries to go stale.  Removing these entries from the
        // reference queue will make them eligible for reclamation.
        emptySoftQueue();
    }
638044
public function clear()
    {

        try {

            DB::table($this->table)->truncate();

        } catch (\Exception $e) {

            throw new SaveException("Cannot clear database: " . $e->getMessage());

        }

    }
263101
protected function clear()
    {
        $this->sql      = null;
        $this->start    = null;
        $this->from     = null;
        $this->join     = null;
        $this->set      = null;
        $this->where    = null;
        $this->groupby  = null;
        $this->orderby  = null;
        $this->limit    = null;
        $this->offset   = null;
    }
1096115
def clear(self):
        
        self.reference = None
        self._pending_ref = None
        super(SimpleDependency, self).clear()
805046
public function clear()
    {
        $this->id = null;
        $this->dealer_id = null;
        $this->is_default = null;
        $this->created_at = null;
        $this->updated_at = null;
        $this->version = null;
        $this->version_created_at = null;
        $this->version_created_by = null;
        $this->dealer_id_version = null;
        $this->dealer_contact_info_ids = null;
        $this->dealer_contact_info_ids_unserialized = null;
        $this->dealer_contact_info_versions = null;
        $this->dealer_contact_info_versions_unserialized = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
59117
public function clear()
    {
        $this->id = null;
        $this->created_at = null;
        $this->updated_at = null;
        $this->version = null;
        $this->version_created_at = null;
        $this->version_created_by = null;
        $this->person_team_link_ids = null;
        $this->person_team_link_ids_unserialized = null;
        $this->person_team_link_versions = null;
        $this->person_team_link_versions_unserialized = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
1105157
public function clear()
    {
        $this->id = null;
        $this->dealer_id = null;
        $this->day = null;
        $this->begin = null;
        $this->end = null;
        $this->closed = null;
        $this->period_begin = null;
        $this->period_end = null;
        $this->created_at = null;
        $this->updated_at = null;
        $this->version = null;
        $this->version_created_at = null;
        $this->version_created_by = null;
        $this->dealer_id_version = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->applyDefaultValues();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
22956
public void clearFieldReference()
    {
        RecordReferenceField field = m_field;
        m_field = null;   // This keeps this from being called twice
        if (field != null)
            field.setReferenceRecord(null);   // Just in case a converter was used (removes converter, leaves field!)
    }
237618
public function clear()
    {
        if (null !== $this->aSkillRelatedByDependencyId) {
            $this->aSkillRelatedByDependencyId->removeChild($this);
        }
        if (null !== $this->aSkillRelatedByParentId) {
            $this->aSkillRelatedByParentId->removeParent($this);
        }
        $this->dependency_id = null;
        $this->parent_id = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
434769
public function clear(): void
    {
        $this->value = null;
        $this->defaultValue = null;
        $this->lenght = -1;
        $this->type = MDataType::UNKNOWN;
        $this->name = null;
    }
795765
protected void clearReferences() {

        // Unregister any JDBC drivers loaded by this classloader
        Enumeration drivers = DriverManager.getDrivers();
        while (drivers.hasMoreElements()) {
            Driver driver = (Driver) drivers.nextElement();
            if (driver.getClass().getClassLoader() == this) {
                try {
                    DriverManager.deregisterDriver(driver);
                } catch (SQLException e) {
                    log.warn("SQL driver deregistration failed", e);
                }
            }
        }
        
        // Null out any static or final fields from loaded classes,
        // as a workaround for apparent garbage collection bugs
        if (ENABLE_CLEAR_REFERENCES) {
            Iterator loadedClasses = ((HashMap)((HashMap) resourceEntries).clone()).values().iterator();
            while (loadedClasses.hasNext()) {
                ResourceEntry entry = (ResourceEntry) loadedClasses.next();
                if (entry.loadedClass != null) {
                    Class clazz = entry.loadedClass;
                    try {
                        Field[] fields = clazz.getDeclaredFields();
                        for (int i = 0; i < fields.length; i++) {
                            Field field = fields[i];
                            int mods = field.getModifiers();
                            if (field.getType().isPrimitive() 
                                    || (field.getName().indexOf("$") != -1)) {
                                continue;
                            }
                            if (Modifier.isStatic(mods)) {
                                try {
                                    field.setAccessible(true);
                                    if (Modifier.isFinal(mods)) {
                                        if (!((field.getType().getName().startsWith("java."))
                                                || (field.getType().getName().startsWith("javax.")))) {
                                            nullInstance(field.get(null));
                                        }
                                    } else {
                                        field.set(null, null);
                                        if (log.isDebugEnabled()) {
                                            log.debug("Set field " + field.getName() 
                                                    + " to null in class " + clazz.getName());
                                        }
                                    }
                                } catch (Throwable t) {
                                    if (log.isDebugEnabled()) {
                                        log.debug("Could not set field " + field.getName() 
                                                + " to null in class " + clazz.getName(), t);
                                    }
                                }
                            }
                        }
                    } catch (Throwable t) {
                        if (log.isDebugEnabled()) {
                            log.debug("Could not clean fields for class " + clazz.getName(), t);
                        }
                    }
                }
            }
        }
        
         // Clear the IntrospectionUtils cache.
        IntrospectionUtils.clear();
        
        // Clear the classloader reference in common-logging
        org.apache.juli.logging.LogFactory.release(this);
        
        // Clear the classloader reference in the VM's bean introspector
        java.beans.Introspector.flushCaches();

    }
1291989
public function clear()
    {
        if (null !== $this->aSkill) {
            $this->aSkill->removeLineageRelatedBySkillId($this);
        }
        if (null !== $this->aAncestor) {
            $this->aAncestor->removeLineageRelatedByAncestorId($this);
        }
        $this->id = null;
        $this->skill_id = null;
        $this->ancestor_id = null;
        $this->position = null;
        $this->alreadyInSave = false;
        $this->clearAllReferences();
        $this->resetModified();
        $this->setNew(true);
        $this->setDeleted(false);
    }
1152978
def clear(self):
        
        self._logger.debug("Component handlers are cleared")

        # Clean up everything to avoid stale references, ...
        self._field = None
        self._name = None
        self._logger = None