Get type

@param $type
@param $label
@return string
358258
public static function getType($type, $label)
    {
        if (empty($type)) {
            if (substr($label, -1 * strlen('.phtml')) == '.phtml') {
                $type = Varien_Profiler::TYPE_TEMPLATE;
            } elseif (strpos($label, 'DISPATCH EVENT:') === 0) {
                $type = Varien_Profiler::TYPE_EVENT;
            } elseif (strpos($label, 'OBSERVER:') === 0) {
                $type = Varien_Profiler::TYPE_OBSERVER;
            } elseif (strpos($label, 'BLOCK:') === 0) {
                $type = Varien_Profiler::TYPE_BLOCK;
            } elseif (strpos($label, 'CORE::create_object_of::') === 0) {
                $type = Varien_Profiler::TYPE_MODEL;
            } elseif (strpos($label, '__EAV_LOAD_MODEL__') === 0) {
                $type = Varien_Profiler::TYPE_EAVMODEL;
            } else {
                $type = Varien_Profiler::TYPE_DEFAULT;
            }
        }
        return $type;
    }
980882
public function label($label = null)
    {
        if (null !== $label) {
            $this->label = $label;

            return $this;
        }

        if (Lang::has($this->label)) {
            return __($this->label);
        }
        return $this->label;
    }
1042315
public function setLabel($label)
    {
        if (is_array($label) && $label['icon']) {
            $this->setIcon($label['icon']);
        } elseif (is_string($label)) {
            return $this->setText($label);
        }

        return $this;
    }
172808
protected function getTitle(Label $label, $raw = false)
    {
        if (!$label->isPlain) {
            return $this->getTranslatedTitle($label, $raw);
        }

        return $this->getPlainTitle($label, $raw);
    }
845126
public static function getInstance($label = 'default')
    {
      $instance = null;

      if(!isset(self::$instances[$label]))
      {
          // Create new Client
          $client = new Client();

          // Save the instance
          self::$instances[$label] = $client;
      }

      $instance = self::$instances[$label];

      return $instance;
    }
355795
protected function getPhpType(Type $type): string
    {
        switch ($builtinType = $type->getBuiltinType()) {
            case Type::BUILTIN_TYPE_ARRAY:
            case Type::BUILTIN_TYPE_INT:
            case Type::BUILTIN_TYPE_FLOAT:
            case Type::BUILTIN_TYPE_BOOL:
            case Type::BUILTIN_TYPE_STRING:
                return $builtinType;
            case Type::BUILTIN_TYPE_OBJECT:
                if (null !== ($className = $type->getClassName()) && is_a($className, \DateTimeInterface::class, true)) {
                    return \DateTimeInterface::class;
                }

            // no break
            default:
                return 'string';
        }
    }
116780
public function getTypeClass($type)
    {
        if (isset($this->types[$type])) {
            return $this->types[$type];
        }

        if (\class_exists($type)) {
            return $type;
        }

        return null;
    }
1060686
public function getTypeLabel(): string
    {
        $provider = Yii::createObject(BillTypesProvider::class);
        $types = ArrayHelper::index($provider->getTypes(), 'name');
        if (!isset($types[$this->type])) {
            return '--';
        }

        return $types[$this->type]->label;
    }
1267177
public function getColumnType($type)
    {
        if (array_key_exists($type, $this->typeMap))
        {
            return $this->typeMap[$type];
        }

        return $this->defaultType;
    }
915993
protected function parseRecordLabel($label)
    {
        $table = null;
        if (false !== strpos($label, '.')) {
            list($table, $label) = explode('.', $label, 2);
        }
        return array($table, $label);
    }
1246850
public function endWith($label = '')
    {
        $label = $label ?: 'End with';

        $condition = [$this->column, 'like', "%{$this->value}"];

        return $this->joinGroup($label, $condition);
    }
899948
public function getLabel($elementKey, $fieldKey, $type = "tt_content")
    {
        $storage = $this->storageRepository->load();
        $fieldIndex = -1;
        if ($storage[$type]["elements"][$elementKey]["columns"] && count($storage[$type]["elements"][$elementKey]["columns"]) > 0) {
            foreach ($storage[$type]["elements"][$elementKey]["columns"] as $index => $column) {
                if ($column == $fieldKey) {
                    $fieldIndex = $index;
                }
            }
        }
        if ($fieldIndex >= 0) {
            $label = $storage[$type]["elements"][$elementKey]["labels"][$fieldIndex];
        } else {
            $label = "";
        }
        return $label;
    }
349928
protected function getBasicTemplate(string $type) : string
    {
        $view = $this->config->getView();
        $result = $view->Form->control('{{name}}', [
            'value' => '{{value}}',
            'type' => $type,
            'label' => false
        ]);

        return $result;
    }
1257531
private static function getTyped($type)
    {
        if (!isset(static::$types[$type])) {
            static::$types[$type] = new self($type);
        }

        return static::$types[$type];
    }
124843
protected function getDefaultOption(string $label = ''): array
    {
        if ($label == '') {
            $label = $this->getDefaultOptionLabel();
        }

        return array('' => $this->translate($label));
    }
670923
public function setLabel($label)
    {
        if (!empty($label) && is_string($label) && ctype_print($label)) {
            $this->label = trim($label);
        }

        return $this;
    }
1258186
public function getSingleNodeByLabel($label)
    {
        foreach ($this->nodes as $node) {
            if ($node->hasLabel($label)) {
                return $node;
            }
        }

        return;
    }