Get filename for the export file
@param  array $fieldgroup Fieldgroup data
@return array
435064
public function getExportFilename(array $fieldgroup) : array
    {
        if ($key = array_search($fieldgroup['key'], $this->exportPosts)) {
            return array(
                'php' => $key . '.php',
                'json' => $key . '.json'
            );
        }

        return array(
            'php' => sanitize_title($fieldgroup['title']) . '.php',
            'json' => sanitize_title($fieldgroup['title']) . '.json'
        );
    }
895501
final function FieldNames(array $aliases = array())
    {
        $fieldNames = array_keys($this->FieldMappers());
        $result = array();
        foreach ($fieldNames as $fieldName)
        {
            if (array_key_exists($fieldName, $aliases))
                $result[$aliases[$fieldName]] = $fieldName;
            else
                $result[] = $fieldName;
        }
        return $result;
    }
326346
private function getGroupByField(): string
    {
        if ('' === $this->groupByField) {
            $this->groupByField = ! empty($this->searchData['group_by']) ? $this->searchData['group_by'] : '';
        }

        return $this->groupByField;
    }
1272010
public function export(array $fieldgroup, bool $restrictToExportPosts = true, bool $translate = true) : array
    {
        global $locale;
        $locale = "en_US";

        // Bail if the fieldgroup shouldn't be exported
        if ($restrictToExportPosts && !in_array($fieldgroup['key'], $this->exportPosts)) {
            return array();
        }

        $this->maybeCreateExportFolders();

        if ($this->textdomain) {
            acf_update_setting('l10n', true);
            acf_update_setting('l10n_textdomain', $this->textdomain);
            acf_update_setting('l10n_var_export', true);
        }

        $filename = $this->getExportFilename($fieldgroup);

        // Export php file
        $this->maybeUnlink($this->exportFolder . 'php/' . $filename['php']);
        $code = $this->generatePhp($fieldgroup['ID'], $translate);
        $phpFile = fopen($this->exportFolder . 'php/' . $filename['php'], 'w');
        fwrite($phpFile, $code);
        fclose($phpFile);

        // Export json file
        $this->maybeUnlink($this->exportFolder . 'json/' . $filename['json']);
        $jsonFile = fopen($this->exportFolder . 'json/' . $filename['json'], 'w');
        $json = $this->getJson($this->getFieldgroupParams($fieldgroup['ID'], false));
        fwrite($jsonFile, $json);
        fclose($jsonFile);

        return array(
            'php' => $this->exportFolder . 'php/' . $filename['php'],
            'json' => $this->exportFolder . 'json/' . $filename['json']
        );
    }
715499
protected function getId($fieldId, $fieldName)
	{
		$id = '';

		// If there is a form control set for the attached form add it first.
		if ($this->formControl)
		{
			$id .= $this->formControl;
		}

		// If the field is in a group add the group control to the field id.
		if ($this->group)
		{
			// If we already have an id segment add the group control as another level.
			if ($id)
			{
				$id .= '_' . str_replace('.', '_', $this->group);
			}
			else
			{
				$id .= str_replace('.', '_', $this->group);
			}
		}

		// If we already have an id segment add the field id/name as another level.
		if ($id)
		{
			$id .= '_' . ($fieldId ? $fieldId : $fieldName);
		}
		else
		{
			$id .= ($fieldId ? $fieldId : $fieldName);
		}

		// Clean up any invalid characters.
		$id = preg_replace('#\W#', '_', $id);

		return $id;
	}
1133001
private function getFiles()
    {
        $fieldname = $this->setting['fieldname'];
        if ($fieldname) {
            $_files = isset($_FILES[$fieldname]) ? $_FILES[$fieldname] : array();
            $files  = [$fieldname => $_files];
        } else {
            //all
            $files = $_FILES;
        }
        return $files;
    }
74813
public function get_group_by(array $cfg): string
  {
    $res = '';
    $group_to_put = [];
    if ( !empty($cfg['group_by']) ){
      foreach ( $cfg['group_by'] as $g ){
        if ( isset($cfg['available_fields'][$g]) ){
          $group_to_put[] = $this->escape($g);
          //$group_to_put[] = $this->col_full_name($g, $cfg['available_fields'][$g], true);
        }
        else{
          $this->db->error("Error! The column '$g' doesn't exist for group by ".print_r($cfg, true));
        }
      }
      if ( count($group_to_put) ){
        $res .= 'GROUP BY '.implode(', ', $group_to_put).PHP_EOL;
      }
    }
    return $res;
  }
529846
public function getFileRelationName($gridField)
    {
        $configFileRelationName = $this->getConfig('fileRelationName');

        return $configFileRelationName ? $configFileRelationName : $this->getDefaultFileRelationName($gridField);
    }
59852
public function getFilePath($fieldName = null, $createPath = true)
    {
        $path = realpath(AppComponent::getUploadsDir($this->container)) . "/" . $this->getFileUri($fieldName);

        foreach ($this->getFileInfo() as $fileInfo) {
            if (isset($fileInfo["field"]) && isset($fileInfo["path"]) && $fieldName == $fileInfo["field"]) {
                $path = $fileInfo["path"];
                break;
            }
        }

        if ($createPath && !is_dir($path)) {
            mkdir($path, 0775, true);
        }

        return $path;
    }
891369
public function getFieldsets($group = null)
	{
		$fieldsets = array();
		$sets = array();

		// Make sure there is a valid Form XML document.
		if (!($this->xml instanceof \SimpleXMLElement))
		{
			return $fieldsets;
		}

		if ($group)
		{
			// Get the fields elements for a given group.
			$elements = &$this->findGroup($group);

			foreach ($elements as &$element)
			{
				// Get an array of <fieldset /> elements and fieldset attributes within the fields element.
				if ($tmp = $element->xpath('descendant::fieldset[@name] | descendant::field[@fieldset]/@fieldset'))
				{
					$sets = array_merge($sets, (array) $tmp);
				}
			}
		}
		else
		{
			// Get an array of <fieldset /> elements and fieldset attributes.
			$sets = $this->xml->xpath('//fieldset[@name] | //field[@fieldset]/@fieldset');
		}

		// If no fieldsets are found return empty.
		if (empty($sets))
		{
			return $fieldsets;
		}

		// Process each found fieldset.
		foreach ($sets as $set)
		{
			// Are we dealing with a fieldset element?
			if ((string) $set['name'])
			{
				// Only create it if it doesn't already exist.
				if (empty($fieldsets[(string) $set['name']]))
				{
					// Build the fieldset object.
					$fieldset = (object) array('name' => '', 'label' => '', 'description' => '');

					foreach ($set->attributes() as $name => $value)
					{
						$fieldset->$name = (string) $value;
					}

					// Add the fieldset object to the list.
					$fieldsets[$fieldset->name] = $fieldset;
				}
			}
			else
			// Must be dealing with a fieldset attribute.
			{
				// Only create it if it doesn't already exist.
				if (empty($fieldsets[(string) $set]))
				{
					// Attempt to get the fieldset element for data (throughout the entire form document).
					$tmp = $this->xml->xpath('//fieldset[@name="' . (string) $set . '"]');

					// If no element was found, build a very simple fieldset object.
					if (empty($tmp))
					{
						$fieldset = (object) array('name' => (string) $set, 'label' => '', 'description' => '');
					}
					else
					// Build the fieldset object from the element.
					{
						$fieldset = (object) array('name' => '', 'label' => '', 'description' => '');

						foreach ($tmp[0]->attributes() as $name => $value)
						{
							$fieldset->$name = (string) $value;
						}
					}

					// Add the fieldset object to the list.
					$fieldsets[$fieldset->name] = $fieldset;
				}
			}
		}

		return $fieldsets;
	}
58075
protected function processNestedGroups($group)
    {
        $data = [];

        if (isset($group['fields']) && is_array($group['fields'])) {
            foreach ($group['fields'] as $fieldName => $field) {
                if (!empty($field['value'])) {
                    $data['fields'][$fieldName] = ['value' => $field['value']];
                }
            }
        }

        if (isset($group['groups']) && is_array($group['groups'])) {
            foreach ($group['groups'] as $groupName => $groupData) {
                $nestedGroup = $this->processNestedGroups($groupData);
                if (!empty($nestedGroup)) {
                    $data['groups'][$groupName] = $nestedGroup;
                }
            }
        }

        return $data;
    }
398052
public function getValues($fieldset = null, $group = null)
    {
        $data = [];

        foreach ($this->getFields($fieldset, $group) as $name => $field) {
            FormHelper::setByPath($data, $name, $field->getRawValue());
        }

        return $data;
    }
902456
protected function getGroupsByNames(array $dns = [], $fields = [])
    {
        $query = $this->query->newInstance();

        return $query->newCollection($dns)->map(function ($dn) use ($query, $fields) {
            return $query->select($fields)->findByDn($dn);
        })->filter(function ($group) {
            return $group instanceof Group;
        });
    }
771615
function get_field_groups( $array )
	{
		// cache
		$found = false;
		$cache = wp_cache_get( 'field_groups', 'acf', false, $found );
		
		if( $found )
		{
			return $cache;
		}
		
		
		// get acf's
		$posts = get_posts(array(
			'numberposts' 	=> -1,
			'post_type' 	=> 'acf',
			'orderby' 		=> 'menu_order title',
			'order' 		=> 'asc',
			'suppress_filters' => false,
		));

		
		// populate acfs
		if( $posts ){ foreach( $posts as $post ){
			
			 $array[] = array(
				'id' => $post->ID,
				'title' => $post->post_title,
				'menu_order' => $post->menu_order,
			);
			
		}}

		
		// set cache
		wp_cache_set( 'field_groups', $array, 'acf' );
				
				
		return $array;
	}
1310503
public function getFileName()
    {
        $filename = substr( strrchr( $this->elfinderFilePath, '/' ), 1 );
        $parts = explode('.',$filename);
        $last = array_pop($parts);
        $filename = str_slug(implode('_',$parts)) . '_' . time();
        return $filename  . '.' . $last;
    }
1085597
public function getFilename()
    {
        /** @var BaseConverter $converter */
        $converter = $this->getDocument()->getConverter();
        return $converter->getDestinationFilenameRelativeToProjectRoot($this->getDocument()->getFile());
    }
842252
public function export(array $fieldIds)
    {
        $fields = array();

        foreach ($fieldIds as $fieldId) {
            $field = Craft::$app->fields->getFieldById($fieldId);

            if ($field) {
                $newField = array(
                    'name' => $field->name,
                    'handle' => $field->handle,
                    'instructions' => $field->instructions,
                    'required' => $field->required,
                    'translationMethod' => $field->translationMethod,
                    'translationKeyFormat' => $field->translationKeyFormat,
                    'type' => \get_class($field),
                    'settings' => $field->settings,
                );

                if (get_class($field) == 'craft\fields\Matrix') {
                    $newField['settings'] = $this->processMatrix($field);
                }

                if (get_class($field) == 'verbb\supertable\fields\SuperTableField') {
                    $newField['settings'] = $this->processSuperTable($field);
                }

                $fields[] = $newField;
            }
        }

        return $fields;
    }