protected function enrichReferenceData(ModelMetaReferenceInterface $data)
    {
        // If the source/strategy are not set, check if we can use the model's reference data
        if (null === $data->source() || null === $data->strategy()) {

            // todo: take into account that this might be a morph relation...

            if ($info = $this->getModelInformation($data->model())) {

                if (null === $data->source()) {
                    $data->source = $info->reference->source;
                }
                if (null === $data->strategy()) {
                    $data->strategy = $info->reference->strategy;
                }
            }
        }

        return $data;
    }
protected function enrichReferenceData(ModelMetaReferenceInterface $data)
    {
        // If the source/strategy are not set, check if we can use the model's reference data
        if (null === $data->source() || null === $data->strategy()) {

            // todo: take into account that this might be a morph relation...

            if ($info = $this->getModelInformation($data->model())) {

                if (null === $data->source()) {
                    $data->source = $info->reference->source;
                }
                if (null === $data->strategy()) {
                    $data->strategy = $info->reference->strategy;
                }
            }
        }

        return $data;
    }
protected function enrichReferenceData ( ModelMetaReferenceInterface $ data ) { // If the source/strategy are not set, check if we can use the model's reference data if ( null === $ data -> source ( ) || null === $ data -> strategy ( ) ) { // todo: take into account that this might be a morph relation... if ( $ info = $ this -> getModelInformation ( $ data -> model ( ) ) ) { if ( null === $ data -> source ( ) ) { $ data -> source = $ info -> reference -> source ; } if ( null === $ data -> strategy ( ) ) { $ data -> strategy = $ info -> reference -> strategy ; } } } return $ data ; }
Enriches refernce data object as required.

@param ModelMetaReferenceInterface|ModelMetaReference $data
@return ModelMetaReferenceInterface
Enriches refernce data object as required .