Remove the internal sort attribute from the option list.

@param GetPropertyOptionsEvent $event The event.

@return void
350303
public function removeOption(GetPropertyOptionsEvent $event)
    {
        $environment = $event->getEnvironment();
        if (('type' !== $event->getPropertyName())
            || ('tl_metamodel_attribute' !== $environment->getDataDefinition()->getName())
        ) {
            return;
        }

        $options = $event->getOptions();
        if (!\array_key_exists('filesort', $options)) {
            return;
        }

        unset($options['filesort']);
        $event->setOptions($options);
    }
499977
public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options)
    {
        $field = $this->getConfig('tagsAssoc.propertyName');
        if (!empty($data[$field]) && (!is_array($data[$field]) || !array_key_exists('_ids', $data[$field]))) {
            $data[$field] = $this->normalizeTags($data[$field]);
        }
        if (isset($data[$field]) && empty($data[$field])) {
            unset($data[$field]);
        }
    }
908358
public function getTableNames(GetPropertyOptionsEvent $event)
    {
        if (!$this->isBackendOptionRequestFor($event, ['tag_table'])) {
            return;
        }

        $sqlTable     = $this->translator->trans(
            'tl_metamodel_attribute.tag_table_type.sql-table',
            [],
            'contao_tl_metamodel_attribute'
        );
        $translated   = $this->translator->trans(
            'tl_metamodel_attribute.tag_table_type.translated',
            [],
            'contao_tl_metamodel_attribute'
        );
        $untranslated = $this->translator->trans(
            'tl_metamodel_attribute.tag_table_type.untranslated',
            [],
            'contao_tl_metamodel_attribute'
        );

        $result = $this->getMetaModelTableNames($translated, $untranslated);
        foreach ($this->connection->getSchemaManager()->listTableNames() as $table) {
            if (0 !== \strpos($table, 'mm_')) {
                $result[$sqlTable][$table] = $table;
            }
        }

        if (\is_array($result[$translated])) {
            \asort($result[$translated]);
        }

        if (\is_array($result[$untranslated])) {
            \asort($result[$untranslated]);
        }

        if (\is_array($result[$sqlTable])) {
            \asort($result[$sqlTable]);
        }

        $event->setOptions($result);
    }
457782
public function beforeSelect(Select $event)
    {
        if ($this->isLazyLoaded()) {
            return;
        }

        $fields = $this->getFieldsPrefixed();
        $table = $this->entityDescriptor->getTableName();
        $relateTable = $this->getParentTableName();
        $pmk = $this->getParentPrimaryKey();

        $onClause = "{$table}.{$this->getForeignKey()} = ".
            "{$relateTable}.{$pmk}";

        $query = $event->getQuery();
        $query->join($relateTable, $onClause, $fields, $relateTable);
    }
773311
public static function off($event)
    {
        if (self::hasEvent($event)) {
            unset(self::$events[$event], self::$eventHandlers[$event]);

            return true;
        }

        return false;
    }
582472
public function handle(DecodePropertyValueForWidgetEvent $event)
    {
        $isAllowed = $this->isAllowedContext(
            $event->getEnvironment()->getDataDefinition(),
            $event->getProperty(),
            $event->getModel()
        );

        if (!$isAllowed) {
            return;
        }

        $model     = $event->getModel();
        $metaModel = $this->getMetaModel($model);
        $value     = $event->getValue();

        if (!($metaModel && $value)) {
            return;
        }

        $attribute = $metaModel->getAttributeById($value);
        if ($attribute) {
            $event->setValue($metaModel->getTableName().'_'.$attribute->getColName());
        }
    }
808901
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener) {
		if (children == null) {
			return;
		}
		PropertyChangeSupport child = (PropertyChangeSupport) children.get(propertyName);
		if (child == null) {
			return;
		}
		child.removePropertyChangeListener(listener);
	}
690432
public function afterDelete(Event $event, EntityInterface $entity, ArrayObject $options) {
		$field = $this->getConfig('field');

		$value = $entity->get($field);
		if (!$value) {
			return;
		}

		$conditions = $this->buildConditions($entity);

		$order = $this->getConfig('findOrder');
		if ($order === null) {
			$order = [];
			if ($this->_table->getSchema()->getColumn('modified')) {
				$order['modified'] = 'DESC';
			}
		}
		$entity = $this->_table->find()->where($conditions)->order($order)->first();
		if (!$entity) {
			// This should be caught with a validation rule if at least one "primary" must exist
			return;
		}

		$entity->set($field, true);
		$this->_table->saveOrFail($entity);
	}
227036
public function loadValues(DecodePropertyValueForWidgetEvent $event)
    {
        if (!$this->scopeDeterminator->currentScopeIsBackend()) {
            return;
        }

        if (($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_attribute')
            || ($event->getProperty() !== 'translatedtabletext_cols')
            || ($event->getEnvironment()->getInputProvider()->getParameter('act') === 'select'
                && !$event->getModel()->getId())
        ) {
            return;
        }

        $metaModelName = $this->factory->translateIdToMetaModelName($event->getModel()->getProperty('pid'));
        $objMetaModel  = $this->factory->getMetaModel($metaModelName);
        $arrLanguages  = $objMetaModel->getAvailableLanguages();

        // Check model and input for the cols and get the max value.
        $intModelCols = $event->getModel()->getProperty('tabletext_quantity_cols');
        $intInputCols = $event->getEnvironment()->getInputProvider()->getValue('tabletext_quantity_cols');
        $intCols      = \max((int) $intModelCols, (int) $intInputCols);

        $varValue = $event->getValue();

        // Kick unused lines.
        foreach ((array) $varValue as $strLanguage => $arrRows) {
            if (\count($arrRows) > $intCols) {
                $varValue[$strLanguage] = array_slice($varValue[$strLanguage], 0, $intCols);
            }
        }

        $arrLangValues = \deserialize($varValue);
        if (!$objMetaModel->isTranslated()) {
            // If we have an array, return the first value and exit, if not an array, return the value itself.
            if (\is_array($arrLangValues)) {
                $event->setValue($arrLangValues[\key($arrLangValues)]);
            } else {
                $event->setValue($arrLangValues);
            }

            return;
        }

        $arrOutput = [];
        // Sort like in MetaModel definition.
        if ($arrLanguages) {
            foreach ($arrLanguages as $strLangCode) {
                if (\is_array($arrLangValues)) {
                    $varSubValue = $arrLangValues[$strLangCode];
                } else {
                    $varSubValue = $arrLangValues;
                }

                if (\is_array($varSubValue)) {
                    $arrOutput[] = ['langcode' => $strLangCode, 'rowLabels' => $varSubValue];
                } else {
                    $arrOutput[] = ['langcode' => $strLangCode, 'value' => $varSubValue];
                }
            }
        }

        $event->setValue(\serialize($arrOutput));
    }
1089110
public function removeOption($key) {
    $globalOptions = $this->globalOptions;
    
    if(array_key_exists($key, $globalOptions)) {
      unset($globalOptions[$key]);
    } else if($key = array_search($key, $globalOptions)) {
      unset($globalOptions[$key]);
    }

    $this->setGlobalOptions($globalOptions);
    $this->pdf = new Pdf($this->globalOptions);
  }
130318
public function beforeMarshal(Event $event, ArrayObject $data, ArrayObject $options) {
		$field = $this->getConfig('field');
		$property = $this->getConfig('tagsAssoc.propertyName');
		$options['accessibleFields'][$property] = true;

		if (isset($data[$field])) {
			$data[$property] = $this->normalizeTags($data[$field]);
		} elseif ($field !== $property) {
			if (isset($data[$property]) && !is_array($data[$property])) {
				throw new RuntimeException('Your `' . $property . '` property is malformed (expected array instead of string). You configured to save list of tags in `' . $field . '` field.');
			}
		}

		if (isset($data[$field]) && empty($data[$field])) {
			unset($data[$field]);
		}
	}
1113542
public function getColumnNames(GetPropertyOptionsEvent $event)
    {
        if (!$this->isBackendOptionRequestFor($event, ['tag_column', 'tag_alias', 'tag_sorting'])) {
            return;
        }

        $result = $this->getColumnNamesFrom($event->getModel()->getProperty('tag_table'));

        if (!empty($result)) {
            \asort($result);
            $event->setOptions($result);
        }
    }
1003046
public function removeListener( $event, EventListener $listener = null ) {

		$event = strtolower( $event );

		if ( !$this->hasEvent( $event ) ) {
			return;
		}

		if ( $listener !== null ) {
			foreach ( $this->dispatchableListeners[$event] as $key => $dispatchableListener ) {
				if ( $dispatchableListener == $listener ) {
					unset( $this->dispatchableListeners[$event][$key] );
				}
			}
		}

		if ( $listener === null || $this->dispatchableListeners[$event] === array() ) {
			unset( $this->dispatchableListeners[$event] );
		}
	}
143883
private function isEventForMe(GetOptionsEvent $event)
    {
        $input = $event->getEnvironment()->getInputProvider();

        if ($input->hasValue('type')) {
            $type = $input->getValue('type');
        }

        if (empty($type)) {
            $type = $event->getModel()->getProperty('type');
        }

        return
            ($event->getEnvironment()->getDataDefinition()->getName() !== 'tl_metamodel_attribute')
            || ($type !== 'translatedalias')
            || ($event->getPropertyName() !== 'talias_fields')
            || ($event->getSubPropertyName() !== 'field_attribute');
    }
723270
public function clearEventHandlers($event = null)
    {
        if (!empty($event)) {
            $this->events[$event] = [];
        } else {
            $this->events = [];
        }
    }
603736
public function beforeDelete($event, $entity, $options)
    {
        $fields = $this->getFieldList();
        foreach ($fields as $field => $data) {
            $fieldConfig = $this->config($field);
            if ($fieldConfig['removeFileOnDelete']) {
                $this->_removeFile($entity->get($field));
            }
        }
    }
982300
private function getOptionsData($event)
    {
        $items = [];
        
        foreach ($this->model->find()->asArray($this->asArray)->all() as $item) {
            if (is_callable($this->labelField, false)) {
                $label = call_user_func($this->labelField, $item);
            } else {
                if ($this->labelField === null) {
                    $this->labelField = array_keys($item);
                }
                $array = ArrayHelper::filter($item, $this->labelField);
                
                foreach ($array as $key => $value) {
                    if ($event->sender->isI18n($key)) {
                        $array[$key] = I18n::decodeFindActive($value);
                    }
                }
                
                $label = $this->labelTemplate ? vsprintf($this->labelTemplate, $array) : implode(', ', $array);
            }
        
            $items[] = ['value' => (int) $item[$this->modelPrimaryKey], 'label' => $label];
        }
        
        return ['items' => $items];
    }