protected function addDiscriminatorColumn(array $attributes): array
    {
        $discriminatorColumn = $this->entityMap->getDiscriminatorColumn();
        $entityClass = $this->entityMap->getClass();

        if (!array_key_exists($discriminatorColumn, $attributes)) {
            // Use key if present in discriminatorMap
            $map = $this->entityMap->getDiscriminatorColumnMap();

            $type = array_search($entityClass, $map);

            if ($type === false) {
                // Use entity FQCN if no corresponding key is set
                $attributes[$discriminatorColumn] = $entityClass;
            } else {
                $attributes[$discriminatorColumn] = $type;
            }
        }

        return $attributes;
    }
protected function addDiscriminatorColumn(array $attributes): array
    {
        $discriminatorColumn = $this->entityMap->getDiscriminatorColumn();
        $entityClass = $this->entityMap->getClass();

        if (!array_key_exists($discriminatorColumn, $attributes)) {
            // Use key if present in discriminatorMap
            $map = $this->entityMap->getDiscriminatorColumnMap();

            $type = array_search($entityClass, $map);

            if ($type === false) {
                // Use entity FQCN if no corresponding key is set
                $attributes[$discriminatorColumn] = $entityClass;
            } else {
                $attributes[$discriminatorColumn] = $type;
            }
        }

        return $attributes;
    }
protected function addDiscriminatorColumn ( array $ attributes ) : array { $ discriminatorColumn = $ this -> entityMap -> getDiscriminatorColumn ( ) ; $ entityClass = $ this -> entityMap -> getClass ( ) ; if ( ! array_key_exists ( $ discriminatorColumn , $ attributes ) ) { // Use key if present in discriminatorMap $ map = $ this -> entityMap -> getDiscriminatorColumnMap ( ) ; $ type = array_search ( $ entityClass , $ map ) ; if ( $ type === false ) { // Use entity FQCN if no corresponding key is set $ attributes [ $ discriminatorColumn ] = $ entityClass ; } else { $ attributes [ $ discriminatorColumn ] = $ type ; } } return $ attributes ; }
Add Discriminator Column if it doesn't exist on the actual entity.

@param array $attributes

@return array
Add Discriminator Column if it doesn t exist on the actual entity .