Method to get property FieldName

@param bool $refresh

@return  string
558662
public function getFieldName($refresh = false)
    {
        if (!$this->fieldName || $refresh) {
            // Prevent double '/'
            $names = array_values(array_filter(explode('/', (string) $this->getName(true)), 'strlen'));

            $control = array_values(array_filter(explode('/', (string) $this->getControl()), 'strlen'));

            $names = array_merge($control, $names);

            $control = array_shift($names);

            $names = array_map(
                function ($value) {
                    return '[' . $value . ']';
                },
                $names
            );

            $this->fieldName = $control . implode('', $names);
        }

        return $this->fieldName;
    }
820230
protected function getFieldName($alias)
    {
        $name = $this->getOption('field');

        if ($this->getOption('auto_alias') && !preg_match('/\./', $name)) {
            $name = "$alias.$name";
        }

        return $name;
    }
727297
private function getGlobalFieldName($defaultName)
    {
        $renameMap = $this->config()->rename;

        if (is_array($renameMap) && array_key_exists($defaultName, $renameMap)) {
            return $renameMap[ $defaultName ];
        }

        return false;
    }
19187
public function getTableDetails($refresh = false)
    {
        if (!isset($this->tableCache[$this->name]) || $refresh) {
            $builder = $this->db->getQuery(true)->getGrammar();

            $query = $builder::showDbTables($this->name);

            $details = $this->db->setQuery($query)->loadAll('Name');

            $this->tableCache[$this->name] = $details;
        }

        return $this->tableCache[$this->name];
    }
495407
public function getColumnDetails($refresh = false)
    {
        if (empty($this->columnCache) || $refresh) {
            $query = PostgresqlGrammar::showTableColumns($this->db->replacePrefix($this->getName()));

            $fields = $this->db->setQuery($query)->loadAll();

            $result = [];

            foreach ($fields as $field) {
                // Do some dirty translation to MySQL output.
                $result[$field->column_name] = (object) [
                    'column_name' => $field->column_name,
                    'type' => $field->column_type,
                    'null' => $field->Null,
                    'Default' => $field->Default,
                    'Field' => $field->column_name,
                    'Type' => $field->column_type,
                    'Null' => $field->Null,
                    'Extra' => null,
                    'Privileges' => null,
                    'Comment' => $field->Comment,
                    'Key' => '',
                ];
            }

            $keys = $this->getIndexes();

            foreach ($result as $field) {
                if (strpos($field->Default, 'nextval') !== false) {
                    $field->Extra = 'auto_increment';
                    $field->Default = 0;
                }

                if (preg_match("/^NULL::*/", $field->Default)) {
                    $field->Default = null;
                }

                if (preg_match("/'(.*)'::[\w\s]/", $field->Default, $matches)) {
                    $field->Default = $matches[1] ?? '';
                }

                if (strpos($field->Type, 'character varying') !== false) {
                    $field->Type = str_replace('character varying', 'varchar', $field->Type);
                }

                // Find key
                $index = null;

                foreach ($keys as $key) {
                    if ($key->column_name == $field->column_name) {
                        $index = $key;
                        break;
                    }
                }

                if ($index) {
                    if ($index->is_primary) {
                        $field->Key = 'PRI';
                    } elseif ($index->is_unique) {
                        $field->Key = 'UNI';
                    } else {
                        $field->Key = 'MUL';
                    }
                }
            }

            $this->columnCache = $result;
        }

        return $this->columnCache;
    }
1003042
public static function getTableIndices( $tableName, $refresh = false )
	{
		static $data = [];
		
		if( isset( $data['$tableName'] ) ) {
			return $data['$tableName'];
		}
		
		$indexes = \Yii::$app->db->schema->getTableIndexes( $tableName, $refresh );
		
		foreach( $indexes as $index ) {
			$data[ $tableName ][ $index->name ] = $index;
		}
		
		return $data;
	}
486451
protected function refreshAbsoluteName()
	{
		$group = $this->group;

		$name = $this->name;

		$this->absoluteName = $group->getUpperRoute() ? $group->getUpperRoute()->getAbsoluteName().'.'.$name : $name;
	}
798053
public function getColumnDetails($refresh = false)
    {
        if (empty($this->columnCache) || $refresh) {
            $query = MysqlGrammar::showTableColumns($this->getName(), true);

            $this->columnCache = $this->db->setQuery($query)->loadAll('Field');
        }

        return $this->columnCache;
    }
1226618
public function hasRequiredSettings(bool $refresh = false): bool
    {
        $required = $this->getParsedRequiredProperties($refresh);

        if (!$this->allRequired && (empty($required) || $required === null)) {
            return true;
        }

        return $this->validateProperties($required);
    }
1039532
public function getValue($forceRefresh = false) {
		if ($this->_value === null || $forceRefresh) {
			if ($this->name === null) {
				throw new InvalidConfigException(get_class($this)." requires a name!");
			}
			$this->_value = (int) $this->getConnection()->getSlave()->get($this->name);
		}
		return $this->_value;
	}
329321
public function getData ($forceRefresh = false) {
        if ($forceRefresh || $this->_data === null) {
            $this->_data = $this->getConnection ()->getSlave ()->zrange ($this->name , 0 , -1 , true);
        }
        return $this->_data;
    }
3898
public function getPairedDevices($refresh = false)
    {
        if ($refresh === false) {
            $device = Discovery::lookupDevice('ip', $this->ip);
            if (isset($device['device']) && is_array($device['device'])) {
                return $device['device'];
            }
        }

        $service = $this->services['BridgeService']['serviceType'];
        $controlUrl = $this->services['BridgeService']['controlURL'];
        $method = 'GetEndDevices';
        $arguments = [
            'DevUDN'      => $this->getUDN($refresh),
            'ReqListType' => 'PAIRED_LIST'
        ];

        $rs = $this->client->request($controlUrl, $service, $method, $arguments);
        $rs = $this->unwrapResponse($rs);
        $rs = WemoClient::xmlToArray($rs['u:GetEndDevicesResponse']['DeviceLists']);

        // Standalone devices.
        $devices = $rs['DeviceLists']['DeviceList']['DeviceInfos'];
        if(static::isArrayAssoc($devices)) {
            $devices = $rs['DeviceLists']['DeviceList']['DeviceInfos']['DeviceInfo'];
        }
        foreach ($devices as $k => $d) {
            $d['IsGroupAction'] = 'NO';
            $devices[$k] = $d;
        }
        // Grouped devices.
        $groupedDeviceList = [];
        $groupedDevices = $rs['DeviceLists']['DeviceList']['GroupInfos'];
        if(static::isArrayAssoc($groupedDevices)) {
            $groupedDeviceList[] = $rs['DeviceLists']['DeviceList']['GroupInfos']['GroupInfo'];
        }
        foreach ($groupedDeviceList as $gd) {
            if(!empty($gd['GroupID']) && !empty($gd['GroupName']) && !empty($gd['GroupCapabilityValues'])) {
                $devices[] = [
                    'DeviceID'      => $gd['GroupID'],
                    'FriendlyName'  => $gd['GroupName'],
                    'CurrentState'  => $gd['GroupCapabilityValues'],
                    'productName'   => $gd['DeviceInfos']['DeviceInfo'][0]['productName'],
                    'IsGroupAction' => 'YES'
                ];
                if(isset($gd['DeviceInfos']) && isset($gd['DeviceInfos']['DeviceInfo'])){
                    foreach($gd['DeviceInfos']['DeviceInfo'] as $gdi){
                        $gdi['IsGroupAction'] = 'NO';
                        $devices[] = $gdi;
                    }
                }
            }
        }
        return $devices;
    }
1233924
protected static function instance($refresh = false)
    {
        if (self::$instance === null || $refresh === true) {
            self::$instance = new self();
        }

        return self::$instance;
    }
187779
public function getShopOrderStatusCodeObject($bRefresh = false)
    {
        if (true === $bRefresh) {
            $this->shopOrderStatusCodeObject = null;
        }
        if (null === $this->shopOrderStatusCodeObject) {
            $this->shopOrderStatusCodeObject = TdbShopOrderStatusCode::GetNewInstance();
            $aFilter = array(
                'shop_id' => $this->getOrder()->fieldShopId,
                'system_name' => $this->getShopOrderStatusCode(),
            );
            if (false === $this->shopOrderStatusCodeObject->LoadFromFields($aFilter)) {
                $shopId = $this->getOrder()->fieldShopId;
                $e = new TPkgShopOrderStatusException_OrderStatusCodeNotFound(
                    "no order status code in shop [{$shopId}] with system_name [{$this->getShopOrderStatusCode()}]",
                    array('orderStatus' => $this)
                );
                $e->setStatusCode($this->getShopOrderStatusCode())
                    ->setShopId($this->getOrder()->fieldShopId);
                throw $e;
            }
        }

        return $this->shopOrderStatusCodeObject;
    }
1245886
private static function prepareFunctionNames($refMethods)
    {
        $fieldNames = explode('.', $refMethods);

        $getters = [];
        foreach ($fieldNames as $field) {
            array_push($getters, 'get'.ucfirst($field));
        }

        return $getters;
    }
967736
protected function getName($field)
    {
        if (is_array($this->name)) {
            return isset($this->name[$field]) ? $this->name[$field] : $field;
        }

        return $this->name ?: $field;
    }
612950
public function getTokens($refresh = false)
    {
        if (! $this->_tokens || $refresh) {
            if ($refresh) {
                $this->_firstToken = null;
            }
            $this->_tokens       = array();
            $this->_activeTokens = array();
            $tokenSelect = $this->tracker->getTokenSelect();
            $tokenSelect->andReceptionCodes()
                ->forRespondentTrack($this->_respTrackId);

            $tokenRows = $tokenSelect->fetchAll();
            $prevToken = null;
            foreach ($tokenRows as $tokenData) {

                $token = $this->tracker->getToken($tokenData);

                $this->_tokens[$token->getTokenId()] = $token;

                // While we are busy, set this
                if ($token->hasSuccesCode()) {
                    $this->_activeTokens[$token->getRoundId()] = $token;
                }

                // Link the tokens
                if ($prevToken) {
                    $prevToken->setNextToken($token);
                }
                $prevToken = $token;
            }
        }

        return $this->_tokens;
    }