protected function allValuesUnique()
    {
        // Init some vars.
        $environment     = $this->getEnvironment();
        $translator      = $environment->getTranslator();
        $dataProvider    = $environment->getDataProvider($this->model->getProviderName());
        $editInformation = $GLOBALS['container']['dc-general.edit-information'];

        // Run each and check the unique flag.
        foreach ($this->getDataDefinition()->getPropertiesDefinition()->getPropertyNames() as $propertyName) {
            $definition = $this->getDataDefinition()->getPropertiesDefinition()->getProperty($propertyName);
            $extra      = $definition->getExtra();
            $value      = $this->model->getProperty($propertyName);

            // Check the flag and the value.
            if (('' !== $value) && $extra['unique'] && isset($extra['unique'])) {
                // Check the database. If return true the value is already in the database.
                if (!$dataProvider->isUniqueValue($propertyName, $value, $this->model->getId())) {
                    $editInformation->setModelError(
                        $this->model,
                        [$translator->translate('not_unique', 'MSC', [$propertyName])],
                        $definition
                    );

                    return false;
                }
            }
        }

        return true;
    }