src/Controller/RelationshipManager.php
public function setSameParent(ModelInterface $receivingModel, ModelInterface $sourceModel, $parentTable)
    {
        $condition = $this->relationships->getChildCondition($parentTable, $receivingModel->getProviderName());
        if (!$condition instanceof ParentChildConditionInterface) {
            throw new DcGeneralRuntimeException(
                'No condition defined from ' . $parentTable . ' to ' . $receivingModel->getProviderName()
            );
        }

        $condition->copyFrom($sourceModel, $receivingModel);
    }
public function setSameParent(ModelInterface $receivingModel, ModelInterface $sourceModel, $parentTable)
    {
        $condition = $this->relationships->getChildCondition($parentTable, $receivingModel->getProviderName());
        if (!$condition instanceof ParentChildConditionInterface) {
            throw new DcGeneralRuntimeException(
                'No condition defined from ' . $parentTable . ' to ' . $receivingModel->getProviderName()
            );
        }

        $condition->copyFrom($sourceModel, $receivingModel);
    }
public function setSameParent ( ModelInterface $ receivingModel , ModelInterface $ sourceModel , $ parentTable ) { $ condition = $ this -> relationships -> getChildCondition ( $ parentTable , $ receivingModel -> getProviderName ( ) ) ; if ( ! $ condition instanceof ParentChildConditionInterface ) { throw new DcGeneralRuntimeException ( 'No condition defined from ' . $ parentTable . ' to ' . $ receivingModel -> getProviderName ( ) ) ; } $ condition -> copyFrom ( $ sourceModel , $ receivingModel ) ; }
Sets all parent condition fields in the destination to the values from the source model.

Useful when moving an element after another in a different parent.

@param ModelInterface $receivingModel The model that shall get updated.
@param ModelInterface $sourceModel    The model that the values shall get retrieved from.
@param string         $parentTable    The name of the parent table for the models.

@return void

@throws DcGeneralRuntimeException When no condition is defined.
Sets all parent condition fields in the destination to the values from the source model .