function toCsvString()
    {

        // Generate standard field string
        $standard_fields = "{";
        if (isset($this->standard_fields)) {
            foreach ($this->standard_fields as $index => $value) {
                $standard_fields .= $index . "=" . $value . ",";
            }
            $standard_fields = rtrim($standard_fields, ',');
        }
        $standard_fields .= "}";

        // Generate custom field string
        $customfields = "{";
        if (isset($this->custom_fields)) {
            foreach ($this->custom_fields as $index => $value) {
                $customfields .= $index . "=" . $value . ",";
            }
            $customfields = rtrim($customfields, ',');
        }
        $customfields .= "}";

        $permission = "";
        if (isset($this->permission)) {
            $permission = $this->permission->getCode();
        }

        return $this->id
        . ";" . $this->email
        . ";" . $permission
        . ";" . $this->external_id
        . ";" . (($this->anonymous == true) ? "true" : "false")
        . ";" . $this->created
        . ";" . $this->updated
        . ";\"" . $standard_fields . "\""
        . ";\"" . $customfields . "\"";
    }