Gets property labels

@return array
332783
private function getLabels($annotations)
    {
        $it = $this->getAnnotations()->filter($annotations)
            ->is(Label::class)
            ->onProperties();
        $labels = [];
        foreach ($it as $annotation) {
            $labels[$annotation->getPropertyName()] = $annotation->value;
        }
        return $labels;
    }
187487
public function getLabel()
    {
        $xpath = new \DOMXPath($this->node->ownerDocument);

        if ($this->node->hasAttribute('id')) {
            $labels = $xpath->query(sprintf('descendant::label[@for="%s"]', $this->node->getAttribute('id')));
            if ($labels->length > 0) {
                return $labels->item(0);
            }
        }

        $labels = $xpath->query('ancestor::label[1]', $this->node);
        if ($labels->length > 0) {
            return $labels->item(0);
        }
    }
645457
public function getPropertiesAsArray()
    {
        $array = array();

        foreach ($this->getProperties() as $property) {
            $array[$property->getName()] = [ 'value' => $property->getValue(), 'type' => $property->getType() ];
        }

        return $array;
    }
236565
protected static function define_properties() : array {
        return array(
                'name' => [
                        'type' => PARAM_TEXT,
                ],
                'shortname' => [
                        'type' => PARAM_TEXT,
                ],
                'type' => [
                        'type' => PARAM_PLUGIN,
                ],
                'description' => [
                        'type' => PARAM_RAW,
                        'optional' => true,
                        'default' => null,
                        'null' => NULL_ALLOWED
                ],
                'descriptionformat' => [
                        'type' => PARAM_INT,
                        'default' => FORMAT_MOODLE,
                        'optional' => true
                ],
                'sortorder' => [
                        'type' => PARAM_INT,
                        'optional' => true,
                        'default' => -1,
                ],
                'categoryid' => [
                        'type' => PARAM_INT
                ],
                'configdata' => [
                        'type' => PARAM_RAW,
                        'optional' => true,
                        'default' => null,
                        'null' => NULL_ALLOWED
                ],
        );
    }
66777
public function getLabel() {
        if ($this->label) {
            return $this->translate($this->label);
        }
        $labels = array();
        if ($this->form->model && is_string($this->form->model)) {
            $class = $this->form->model;
            $labels = $class::getLabels();
        } elseif ($this->form->model && is_object($this->form->model)) {
            $class = get_class($this->form->model);
            $labels = $class::getLabels();
        }
        if (isset($labels[$this->name])) {
            return $this->translate($labels[$this->name]);
        }
        return $this->translate(ucwords(str_replace('_', ' ', $this->name)));
    }
1148055
public function listDataTypesOptions() {
    $data = $this->loadDataTypeData();

    $return = [];
    foreach ($data as $id => $data_item) {
      $return[$id] = $data_item['label'];
    }

    return $return;
  }
464582
public function getProperties()
    {
        if (!$this->propertiesCache) {
            $this->propertiesCache = [];
            foreach (array_keys($this->properties) as $name) {
                $this->propertiesCache[$name] = $this->getProperty($name);
            }
        }

        return $this->propertiesCache;
    }
745502
public function getPropertyNames() {
    return array_map(function (ClassMemberNode $property) {
      return ltrim($property->getName(), '$');
    }, $this->getProperties()->toArray());
  }
1186174
public function getRawData()
    {
        return [
            'ord' => $this->ord,
            'viewname' => $this->viewname,
            'label_en' => $this->labels['en'],
            'label_fr' => $this->labels['fr'],
            'label_de' => $this->labels['de'],
            'label_nl' => $this->labels['nl'],
        ];
    }
1112236
protected static function define_properties() {
        return [
            'id' => [
                'type' => PARAM_INT,
                'description' => 'Alignment id',
            ],
            'badgeid' => [
                'type' => PARAM_INT,
                'description' => 'Badge id',
            ],
            'targetname' => [
                'type' => PARAM_TEXT,
                'description' => 'Target name',
            ],
            'targeturl' => [
                'type' => PARAM_URL,
                'description' => 'Target URL',
            ],
            'targetdescription' => [
                'type' => PARAM_TEXT,
                'description' => 'Target description',
                'null' => NULL_ALLOWED,
                'optional' => true,
            ],
            'targetframework' => [
                'type' => PARAM_TEXT,
                'description' => 'Target framework',
                'null' => NULL_ALLOWED,
                'optional' => true,
            ],
            'targetcode' => [
                'type' => PARAM_TEXT,
                'description' => 'Target code',
                'null' => NULL_ALLOWED,
                'optional' => true,
            ]
        ];
    }
103034
public static function getAllLabels()
    {
        // Load Plugin translations
        $labels = [];
        foreach(self::activePlugins() as $plugin){
            if(File::isDirectory($plugin->translationsPath().'/'.App::getLocale())) {
                $translationFiles = File::files($plugin->translationsPath() . '/' . App::getLocale());
                foreach ($translationFiles as $file) {
                    $fileName = str_replace('.php', '', $file->getFilename());

                    $pluginNamespace = explode(".", $plugin->namespaceWithDot());

                    // set a array key for each plugin author
                    if(!isset($labels[$pluginNamespace[0]])) {
                        $labels[$pluginNamespace[0]] = [];
                    }
                    // set a array key for each plugin
                    if(!isset($labels[$pluginNamespace[0]][$pluginNamespace[1]])) {
                        $labels[$pluginNamespace[0]][$pluginNamespace[1]] = [];
                    }

                    $labels[$pluginNamespace[0]][$pluginNamespace[1]][$fileName] = File::getRequire($file->getPathName());
                }
            }
        }

        return $labels;
    }
325077
public function objLabels()
    {
        if ($this->objLabels === null) {
            $objLabels = [];
            $proto = $this->proto();
            $objMetadata = $proto->metadata();
            if (isset($objMetadata['labels']) && !empty($objMetadata['labels'])) {
                $objLabels = $objMetadata['labels'];
                array_walk($objLabels, function(&$value) {
                    $value = $this->translator()->translation($value);
                });
                $this->objLabels = $objLabels;
            }
        }

        return $this->objLabels;
    }
359260
protected function getLabelValues(array $labels)
    {
        $values = [];

        foreach ($labels as $label) {
            if ($label instanceof Label) {
                $values[] = $label->value;
            }
        }

        return $values;
    }
1089390
public function getProperties()
    {
        //todo cache
        $result = array();
        foreach ($this->getReflectionClass()->getProperties() as $m)
        {
            $result[] = PropertyInfo::__internal_create($this, $m);
        }
        return $result;
    }
236816
protected static function define_properties() : array {
        return array(
                'name' => [
                        'type' => PARAM_TEXT,
                ],
                'description' => [
                        'type' => PARAM_RAW,
                        'optional' => true,
                        'default' => null,
                        'null' => NULL_ALLOWED
                ],
                'descriptionformat' => [
                        'type' => PARAM_INT,
                        'default' => FORMAT_MOODLE,
                        'optional' => true
                ],
                'component' => [
                        'type' => PARAM_COMPONENT
                ],
                'area' => [
                        'type' => PARAM_COMPONENT
                ],
                'itemid' => [
                        'type' => PARAM_INT,
                        'optional' => true,
                        'default' => 0
                ],
                'contextid' => [
                        'type' => PARAM_INT,
                        'optional' => false
                ],
                'sortorder' => [
                        'type' => PARAM_INT,
                        'optional' => true,
                        'default' => -1
                ],
        );
    }
1176086
protected function getLabel()
	{
		if ($this->label !== false && !in_array($this->type, array('checkbox', 'radio')) && $this->hasModel())
			return $this->form->labelEx($this->model, $this->attribute, $this->labelOptions);
		else if ($this->label !== null)
			return $this->label;
		else
			return '';
	}
1061139
public function attributeLabels()
    {
        return array_merge(parent::attributeLabels(), [
            'username'        => Yii::t('usr', 'Username'),
            'email'            => Yii::t('usr', 'Email'),
            'activationKey'    => Yii::t('usr', 'Activation Key'),
        ], $this->getBehaviorLabels());
    }