src/Controller/DefaultController.php
private function handleClonedModelProperty(
        ModelInterface $model,
        PropertyInterface $property,
        DataProviderInterface $dataProvider
    ) {
        $extra    = $property->getExtra();
        $propName = $property->getName();

        // Check doNotCopy.
        if (isset($extra['doNotCopy']) && (true === $extra['doNotCopy'])) {
            $model->setProperty($propName, null);
            return;
        }

        // Check uniqueness.
        if (isset($extra['unique'])
            && (true === $extra['unique'])
            && !$dataProvider->isUniqueValue($propName, $model->getProperty($propName))
        ) {
            // Implicit "do not copy" unique values, they cannot be unique anymore.
            $model->setProperty($propName, null);
        }
    }
private function handleClonedModelProperty(
        ModelInterface $model,
        PropertyInterface $property,
        DataProviderInterface $dataProvider
    ) {
        $extra    = $property->getExtra();
        $propName = $property->getName();

        // Check doNotCopy.
        if (isset($extra['doNotCopy']) && (true === $extra['doNotCopy'])) {
            $model->setProperty($propName, null);
            return;
        }

        // Check uniqueness.
        if (isset($extra['unique'])
            && (true === $extra['unique'])
            && !$dataProvider->isUniqueValue($propName, $model->getProperty($propName))
        ) {
            // Implicit "do not copy" unique values, they cannot be unique anymore.
            $model->setProperty($propName, null);
        }
    }
private function handleClonedModelProperty ( ModelInterface $ model , PropertyInterface $ property , DataProviderInterface $ dataProvider ) { $ extra = $ property -> getExtra ( ) ; $ propName = $ property -> getName ( ) ; // Check doNotCopy. if ( isset ( $ extra [ 'doNotCopy' ] ) && ( true === $ extra [ 'doNotCopy' ] ) ) { $ model -> setProperty ( $ propName , null ) ; return ; } // Check uniqueness. if ( isset ( $ extra [ 'unique' ] ) && ( true === $ extra [ 'unique' ] ) && ! $ dataProvider -> isUniqueValue ( $ propName , $ model -> getProperty ( $ propName ) ) ) { // Implicit "do not copy" unique values, they cannot be unique anymore. $ model -> setProperty ( $ propName , null ) ; } }
Handle a property in a cloned model.

@param ModelInterface        $model        The cloned model.
@param PropertyInterface     $property     The property to handle.
@param DataProviderInterface $dataProvider The data provider the model originates from.

@return void
Handle a property in a cloned model .