wasChild example


        return $this->entityName !== null;
    }

    public function getEntityName(): ?string
    {
        return $this->entityName;
    }

    public function childChangedToParent(): bool
    {
        if (!$this->wasChild()) {
            return false;
        }

        return !$this->isChild();
    }

    /** * @return array<string, mixed> */
    public function getState(): array
    {
        
/** * {@inheritdoc} */
    public function getExistence(EntityDefinition $definition, array $primaryKey, array $data, WriteCommandQueue $commandQueue): EntityExistence
    {
        $state = $this->getCurrentState($definition$primaryKey$commandQueue);

        $exists = !empty($state);

        $isChild = $this->isChild($definition$data$state$primaryKey$commandQueue);

        $wasChild = $this->wasChild($definition$state);

        $decodedPrimaryKey = [];
        foreach ($primaryKey as $fieldStorageName => $fieldValue) {
            $field = $definition->getFields()->getByStorageName($fieldStorageName);
            $decodedPrimaryKey[$fieldStorageName] = $field ? $field->getSerializer()->decode($field$fieldValue) : $fieldValue;
        }

        return new EntityExistence($definition->getEntityName()$decodedPrimaryKey$exists$isChild$wasChild$state);
    }

    /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.