Generate the country column.

@param \stdClass $data
@return string
515392
public function col_country($data) {
        if (!empty($this->countries[$data->country])) {
            return $this->countries[$data->country];
        }
        return '';
    }
1343623
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $beGroupUids = $recordFinder->findUidsOfDemoBeGroups();
        $beUserUids = $recordFinder->findUidsOfDemoBeUsers();
        $result = [];
        foreach ($beGroupUids as $uid) {
            $result[] = 'be_groups_' . $uid;
        }
        foreach ($beUserUids as $uid) {
            $result[] = 'be_users_' . $uid;
        }
        return implode(',', $result);
    }
1261743
public static function classInfo($data)
    {
        $result = self::_getClass($data);
        if ($result) {
            $data = $result['name'];
        }

        return self::i()->dump($result, '! class (' . $data . ') !');
    }
167255
private function getFormFields (stdClass $data)
    {
        $output = '';

        $output .= $this->getFields(
            $data->mainModel,
            $data->translationsLocation,
            array_merge ($this->getAutoFill(), ['id']),
            file_get_contents(__DIR__ . '/../templates/service/form/basic.field.hctpl'));

        if (isset($data->mainModel->multiLanguage))
            $output .= $this->getFields(
                $data->mainModel->multiLanguage,
                $data->translationsLocation,
                array_merge ($this->getAutoFill(), ['id', 'record_id', 'language_code']),
                file_get_contents(__DIR__ . '/../templates/service/form/multi.field.hctpl'));

        return $output;
    }
760850
public function convertFieldValueFromForm($data)
    {
        $country = array();

        // case if multiple is true
        if (is_array($data)) {
            foreach ($data as $countryCode) {
                if (array_key_exists($countryCode, $this->countryData)) {
                    $country[$countryCode] = $this->countryData[$countryCode];
                }
            }
        } else {
            if (array_key_exists($data, $this->countryData)) {
                $country[$data] = $this->countryData[$data];
            }
        }

        return new CountryValue((array) $country);
    }
960707
public function generate(array $data): string
    {
        // Get second value from "items" of wizard
        $values = $data['fieldConfig']['config']['valuePicker']['items'];
        array_shift($values);
        $keyValue = array_shift($values);
        return $keyValue[1];
    }
1002028
public function generate(array $data): string
    {
        /** @var RecordFinder $recordFinder */
        $recordFinder = GeneralUtility::makeInstance(RecordFinder::class);
        $folder = $recordFinder->findDemoFolderObject();
        return $folder->getCombinedIdentifier();
    }
300268
protected function transformAll(stdClass $data)
    {
        $name = $this->getFirstPropertyName($data);

        return array_map(function ($data) use ($name) {
            return $this->transform($data, $name);
        }, $this->getFirstProperty($data));
    }
792403
public function format($data)
    {
        $data->loopThrough(function ($key, $value) use ($data) {
            if (!in_array($key, $this->fields)) {
                $data->setProperty($key, null);
            }
        });

        $data->unsetNull();

        return $data;
    }
456037
public function generate(array $data): string
    {
        // Nothing by default
        $value = '';
        // Set second value selected if there is more than one item
        if (isset($data['fieldConfig']['config']['items'])
            && is_array($data['fieldConfig']['config']['items'])
            && count($data['fieldConfig']['config']['items']) > 1
        ) {
            $values = $data['fieldConfig']['config']['items'];
            array_shift($values);
            $value = array_shift($values);
            $value = $value[1];
        }
        return (string)$value;
    }
1186701
public function generate($data)
	{
		$result = [];

		foreach ($data as $config)
		{
			$type = 'text';

			if (array_key_exists('type', $config))
			{
				$type = $config['type'];
			}

			$generateFunction = 'generate' . ucfirst($type);

			if (method_exists($this, $generateFunction))
			{
				$result[] = $this->$generateFunction($config);
			}
			else
			{
				$result[] = $this->generateInput($type, $config);
			}
		}

		return $result;
	}
1109505
public function get_label($data) {
        global $DB;

        $role = $DB->get_record('role', array('id' => $data['value']));

        $a = new stdClass();
        $a->label = $this->_label;
        $a->value = '"'.role_get_name($role).'"';

        return get_string('globalrolelabel', 'filters', $a);
    }
517414
public function generate($data){
		$this->setTitle(BLang::_('USERS_REGISTER_HTML_TITLE'));
		$this->addMeta('description',BLang::_('USERS_REGISTER_METADESC'));
		return $this->templateLoad();
		}
1172471
public function generate(array $data): string
    {
        $childTable = $data['fieldConfig']['config']['foreign_table'];
        // Insert an empty row again to have the uid already. This is useful for
        // possible further inline that may be attached to this child.
        $childFieldValues = [
            'pid' => $data['fieldValues']['pid'],
            'parentid' => $data['fieldValues']['uid'],
            'parenttable' => $data['tableName'],
        ];
        $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable($childTable);
        $connection->insert($childTable, $childFieldValues);
        $childFieldValues['uid'] = (int)$connection->lastInsertId($childTable);
        $recordData = GeneralUtility::makeInstance(RecordData::class);
        $childFieldValues = $recordData->generate($childTable, $childFieldValues);
        $connection->update(
            $childTable,
            $childFieldValues,
            [ 'uid' => $childFieldValues['uid'] ]
        );
        return (string)1;
    }
62492
private function generateYaml(array $data)
    {
        $fileContent = array();
        $header = array();
        foreach ($data as $path => $scopes) {
            $paths = explode('/', $path);
            if (!isset($header[$paths[0]])) {
                $header[$paths[0]] = true;
                $length = strlen($paths[0]) + 2;
                $fileContent[] = PHP_EOL . $this->getIndentation($length, '#') . PHP_EOL . '# ' . $paths[0] . PHP_EOL . $this->getIndentation($length, '#');
            }

            $fileContent[] = $path . ':';
            foreach ($scopes as $scope => $scopeValues) {
                $fileContent[] = $this->getIndentation(2) . $scope . ':';
                foreach ($scopeValues as $scopeId => $value) {
                    $fileContent[] = $this->getIndentation(4) . $scopeId . ': ' . $this->prepareValue($value);
                }
            }
        }

        return implode(PHP_EOL, $fileContent);
    }
896590
public function fitsToCountry($data) {
		if (!isset($data['country_id']) || !isset($data['country_province_id'])) {
			return true;
		}
		$res = $this->Countries->States->find('list', [
			'conditions' => ['country_id' => $data['country_id']]
		])->toArray();
		if (empty($res) || array_shift($data) == 0) {
			$data['country_province_id'] = 0;
		} elseif (empty($data['country_province_id']) || !array_key_exists($data['country_province_id'], $res)) {
			return false;
		}
		return true;
	}
529552
protected function transform(stdClass $data, $className = null)
    {
        $model = null;
        $name = !empty($className) ? $className : $this->getFirstPropertyName($data);
        $data = !empty($className) ? $data : $this->getFirstProperty($data);
        $class = '\\Pokemon\\Models\\' . ucfirst(Inflector::singularize($name));
        if (class_exists($class)) {
            /** @var Model $model */
            $model = new $class;
            $model->fill($data);
        }

        return $model;
    }