Removes fieldDefinition data from multilingual table.

@param int $fieldDefinitionId
@param string $languageCode
@param int $status
559275
public function removeFieldDefinitionTranslation(
        int $fieldDefinitionId,
        string $languageCode,
        int $status
    ): void {
        try {
            $this->innerGateway->removeFieldDefinitionTranslation(
                $fieldDefinitionId,
                $languageCode,
                $status
            );
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
547563
@Override
	public void removeByC_S(long CProductId, int status) {
		for (CPDefinition cpDefinition : findByC_S(CProductId, status,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinition);
		}
	}
475872
public function getFieldName(SPIValue $value, FieldDefinition $fieldDefinition, $languageCode)
    {
        return $this->fieldType->getName($value);
    }
366680
protected function processDefinition($countryCode, array $definition)
    {
        $definition['country_code'] = $countryCode;
        // Merge-in defaults.
        $definition += $this->getGenericDefinition();
        // Always require the given name and family name.
        $definition['required_fields'][] = AddressField::GIVEN_NAME;
        $definition['required_fields'][] = AddressField::FAMILY_NAME;

        return $definition;
    }
1301987
public function deleteFieldDefinitionsForType($typeId, $status)
    {
        $q = $this->dbHandler->createDeleteQuery();
        $q->deleteFrom(
            $this->dbHandler->quoteTable('ezcontentclass_attribute')
        )->where(
            $q->expr->lAnd(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentclass_id'),
                    $q->bindValue($typeId, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version'),
                    $q->bindValue($status, null, \PDO::PARAM_INT)
                )
            )
        );

        $q->prepare()->execute();
        $subQuery = $this->connection->createQueryBuilder();
        $subQuery
            ->select('attr.id as ezcontentclass_attribute_id')
            ->from('ezcontentclass_attribute', 'attr')
            ->where('attr.contentclass_id = :typeId')
            ->andWhere('attr.id = ezcontentclass_attribute_ml.contentclass_attribute_id');

        $deleteQuery = $this->connection->createQueryBuilder();
        $deleteQuery
            ->delete('ezcontentclass_attribute_ml')
            ->where(
                sprintf('EXISTS (%s)', $subQuery->getSQL())
            )
            ->andWhere('ezcontentclass_attribute_ml.version = :status')
            ->setParameter('typeId', $typeId, ParameterType::INTEGER)
            ->setParameter('status', $status, ParameterType::INTEGER);

        $deleteQuery->execute();
    }
204339
@Override
	public void removeByCPDefinitionId(long CPDefinitionId) {
		for (CPInstance cpInstance : findByCPDefinitionId(CPDefinitionId,
				QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpInstance);
		}
	}
100136
public function loadFieldDefinition($id, $status)
    {
        $q = $this->dbHandler->createSelectQuery();
        $this->selectColumns($q, 'ezcontentclass_attribute');
        $q->select([
                'ezcontentclass.initial_language_id AS ezcontentclass_initial_language_id',
                'ezcontentclass_attribute_ml.name AS ezcontentclass_attribute_multilingual_name',
                'ezcontentclass_attribute_ml.description AS ezcontentclass_attribute_multilingual_description',
                'ezcontentclass_attribute_ml.language_id AS ezcontentclass_attribute_multilingual_language_id',
                'ezcontentclass_attribute_ml.data_text AS ezcontentclass_attribute_multilingual_data_text',
                'ezcontentclass_attribute_ml.data_json AS ezcontentclass_attribute_multilingual_data_json',
            ]);
        $q->from(
            $this->dbHandler->quoteTable('ezcontentclass_attribute')
        )->leftJoin(
            'ezcontentclass',
            $q->expr->lAnd(
                $q->expr->eq('ezcontentclass_attribute.contentclass_id', 'ezcontentclass.id'),
                $q->expr->eq('ezcontentclass_attribute.version', 'ezcontentclass.version')
            )
        )->leftJoin(
            'ezcontentclass_attribute_ml',
            $q->expr->lAnd(
                $q->expr->eq('ezcontentclass_attribute.id', 'ezcontentclass_attribute_ml.contentclass_attribute_id'),
                $q->expr->eq('ezcontentclass_attribute.version', 'ezcontentclass_attribute_ml.version')
            )
        )->where(
            $q->expr->lAnd(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('id', 'ezcontentclass_attribute'),
                    $q->bindValue($id, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version', 'ezcontentclass_attribute'),
                    $q->bindValue($status, null, \PDO::PARAM_INT)
                )
            )
        );

        $stmt = $q->prepare();
        $stmt->execute();

        return $stmt->fetchAll(\PDO::FETCH_ASSOC);
    }
1067404
public function updateFieldDefinition(
        $typeId,
        $status,
        FieldDefinition $fieldDefinition,
        StorageFieldDefinition $storageFieldDef
    ) {
        $q = $this->dbHandler->createUpdateQuery();
        $q
            ->update(
                $this->dbHandler->quoteTable('ezcontentclass_attribute')
            )->where(
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('id'),
                    $q->bindValue($fieldDefinition->id, null, \PDO::PARAM_INT)
                ),
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('version'),
                    $q->bindValue($status, null, \PDO::PARAM_INT)
                ),
                // @todo FIXME: Actually not needed
                $q->expr->eq(
                    $this->dbHandler->quoteColumn('contentclass_id'),
                    $q->bindValue($typeId, null, \PDO::PARAM_INT)
                )
            );
        $this->setCommonFieldColumns($q, $fieldDefinition, $storageFieldDef);

        $q->prepare()->execute();

        foreach ($storageFieldDef->multilingualData as $languageCode => $data) {
            $dataExist = $this->fieldDefinitionMultilingualDataExist(
                $fieldDefinition,
                $data->languageId,
                $status
            );

            if ($dataExist) {
                $this->updateFieldDefinitionMultilingualData(
                    $fieldDefinition->id,
                    $data,
                    $status
                );
            } else {
                //When creating new translation there are no fields for update.
                $this->insertFieldDefinitionMultilingualData(
                    $fieldDefinition->id,
                    $data,
                    $status
                );
            }
        }
    }
706343
public function delete(EntityDefinition $definition, array $ids, WriteContext $writeContext): DeleteResult
    {
        $this->validateWriteInput($ids);

        $commandQueue = new WriteCommandQueue();

        $fields = $definition->getPrimaryKeys();

        $resolved = [];
        foreach ($ids as $raw) {
            $mapped = [];

            /** @var Field $field */
            foreach ($fields as $field) {
                if (!($field instanceof StorageAware)) {
                    continue;
                }

                if (array_key_exists($field->getPropertyName(), $raw)) {
                    $mapped[$field->getStorageName()] = $raw[$field->getPropertyName()];
                    continue;
                }

                if ($field instanceof ReferenceVersionField) {
                    $mapped[$field->getStorageName()] = $writeContext->getContext()->getVersionId();
                    continue;
                }

                if ($field instanceof VersionField) {
                    $mapped[$field->getStorageName()] = $writeContext->getContext()->getVersionId();
                    continue;
                }

                $fieldKeys = $fields
                    ->filter(function (Field $field) {
                        return !$field instanceof VersionField && !$field instanceof ReferenceVersionField;
                    })
                    ->map(function (Field $field) {
                        return $field->getPropertyName();
                    });

                throw new IncompletePrimaryKeyException($fieldKeys);
            }

            $resolved[] = $mapped;
        }

        if (!$definition instanceof MappingEntityDefinition) {
            $restrictions = $this->foreignKeyResolver->getAffectedDeleteRestrictions($definition, $resolved, $writeContext->getContext());

            if (!empty($restrictions)) {
                $restrictions = array_map(function ($restriction) {
                    return new RestrictDeleteViolation($restriction['pk'], $restriction['restrictions']);
                }, $restrictions);

                throw new RestrictDeleteViolationException($definition, $restrictions, $this->registry);
            }
        }

        $cascades = [];
        if (!$definition instanceof MappingEntityDefinition) {
            $cascadeDeletes = $this->foreignKeyResolver->getAffectedDeletes($definition, $resolved, $writeContext->getContext());

            $cascadeDeletes = array_column($cascadeDeletes, 'restrictions');
            foreach ($cascadeDeletes as $cascadeDelete) {
                $cascades = array_merge_recursive($cascades, $cascadeDelete);
            }

            foreach ($cascades as $affectedDefinitionClass => &$cascade) {
                $affectedDefinition = $this->registry->get($affectedDefinitionClass);

                $cascade = array_map(function ($key) use ($affectedDefinition) {
                    $payload = $key;

                    if (!\is_array($key)) {
                        $payload = ['id' => $key];
                    }

                    return new EntityWriteResult($key, $payload, $affectedDefinition, null);
                }, $cascade);
            }
        }

        $skipped = [];
        foreach ($resolved as $mapped) {
            $mappedBytes = array_map(function ($id) {
                return Uuid::fromHexToBytes($id);
            }, $mapped);

            $existence = $this->gateway->getExistence($definition, $mappedBytes, [], $commandQueue);

            if (!$existence->exists()) {
                $skipped[$definition->getClass()][] = new EntityWriteResult($mapped, $mapped, $definition, $existence);
                continue;
            }

            $commandQueue->add(
                $definition,
                new DeleteCommand(
                    $definition,
                    $mappedBytes,
                    $existence
                )
            );
        }

        $writeContext->setLanguages($this->languageLoader->loadLanguages());
        $identifiers = $this->getWriteResults($commandQueue);
        $this->gateway->execute($commandQueue->getCommandsInOrder(), $writeContext);

        return new DeleteResult(
            array_merge_recursive($identifiers, $cascades),
            $skipped
        );
    }
980604
function removeTranslation( $languageID )
    {
        $language = eZContentLanguage::fetch( $languageID );

        if ( !$language )
        {
            return false;
        }

        // check if it is not the initial language
        $classInitialLanguageID = $this->attribute( 'initial_language_id' );
        if ( $classInitialLanguageID == $languageID )
        {
            return false;
        }

        $db = eZDB::instance();
        $db->begin();

        $classID = $this->attribute( 'id' );
        $languageID = $language->attribute( 'id' );

        // change language_mask of the object
        $languageMask = (int) $this->attribute( 'language_mask' );
        $languageMask = (int) $languageMask & ~ (int) $languageID;
        $this->setAttribute( 'language_mask', $languageMask );

        // Remove all names in the language
        $db->query( "DELETE FROM ezcontentclass_name
                     WHERE contentclass_id='$classID'
                       AND language_id='$languageID'" );

        $languageLocale = $language->attribute( 'locale' );
        $this->NameList->removeName( $languageLocale );
        $this->DescriptionList->removeName( $languageLocale );

        $this->store();

        // Remove names for attributes in the language
        $attributes = $this->fetchAttributes();
        foreach ( $attributes as $attribute )
        {
            $attribute->removeTranslation( $languageLocale );
            $attribute->store();
        }

        $db->commit();

        return true;
    }
1259118
public function setStatusCode($statusCode, $statusText = null)
    {
        if ($statusText === null
            && array_key_exists((int) $statusCode, $this->statusTexts)
        ) {
            $statusText = $this->statusTexts[$statusCode];
        }

        $this->statusCode = (int) $statusCode;
        $this->statusText = (string) $statusText;
    }
848157
@com.fasterxml.jackson.annotation.JsonProperty("DetectedLanguageCode")
    public void setDetectedLanguageCode(String detectedLanguageCode) {
        this.detectedLanguageCode = detectedLanguageCode;
    }
300082
protected function createField($id, $versionNo, $languageCode)
    {
        $field = new Field();

        $field->id = $id;
        $field->fieldDefinitionId = $this->fieldDefinition->id;
        $field->type = $this->fieldDefinition->fieldType;
        $field->value = clone $this->fieldDefinition->defaultValue;
        $field->versionNo = $versionNo;
        $field->languageCode = $languageCode;

        return $field;
    }
497008
public function removeContentTypeTranslation(ContentTypeDraft $contentTypeDraft, string $languageCode): ContentTypeDraft
    {
        $contentTypeDraft = $this->service->removeContentTypeTranslation($contentTypeDraft, $languageCode);
        $this->signalDispatcher->emit(
            new RemoveContentTypeDraftTranslationSignal(
                [
                    'contentTypeDraftId' => $contentTypeDraft->id,
                    'languageCode' => $languageCode,
                ]
            )
        );

        return $contentTypeDraft;
    }
209739
public function listGlobalEntries($languageCode = null, $offset = 0, $limit = -1)
    {
        $limit = $limit === -1 ? self::MAX_LIMIT : $limit;

        /** @var $query \eZ\Publish\Core\Persistence\Database\SelectQuery */
        $query = $this->dbHandler->createSelectQuery();
        $query->select(
            $this->dbHandler->quoteColumn('action'),
            $this->dbHandler->quoteColumn('id'),
            $this->dbHandler->quoteColumn('link'),
            $this->dbHandler->quoteColumn('is_alias'),
            $this->dbHandler->quoteColumn('alias_redirects'),
            $this->dbHandler->quoteColumn('lang_mask'),
            $this->dbHandler->quoteColumn('is_original'),
            $this->dbHandler->quoteColumn('parent'),
            $this->dbHandler->quoteColumn('text_md5')
        )->from(
            $this->dbHandler->quoteTable($this->table)
        )->where(
            $query->expr->lAnd(
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('action_type'),
                    $query->bindValue('module', null, \PDO::PARAM_STR)
                ),
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('is_original'),
                    $query->bindValue(1, null, \PDO::PARAM_INT)
                ),
                $query->expr->eq(
                    $this->dbHandler->quoteColumn('is_alias'),
                    $query->bindValue(1, null, \PDO::PARAM_INT)
                )
            )
        )->limit(
            $limit,
            $offset
        );
        if (isset($languageCode)) {
            $query->where(
                $query->expr->gt(
                    $query->expr->bitAnd(
                        $this->dbHandler->quoteColumn('lang_mask'),
                        $query->bindValue(
                            $this->languageMaskGenerator->generateLanguageIndicator($languageCode, false),
                            null,
                            \PDO::PARAM_INT
                        )
                    ),
                    0
                )
            );
        }
        $statement = $query->prepare();
        $statement->execute();

        return $statement->fetchAll(\PDO::FETCH_ASSOC);
    }
201103
public function getFieldDefinitionById($fieldDefinitionId)
    {
        if (isset($this->fieldDefinitionsById[$fieldDefinitionId])) {
            return $this->fieldDefinitionsById[$fieldDefinitionId];
        }

        return null;
    }
851860
@Override
	public void removeByCPD_T(long CPDefinitionId, String type) {
		for (CPDefinitionLink cpDefinitionLink : findByCPD_T(CPDefinitionId,
				type, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
			remove(cpDefinitionLink);
		}
	}