protected function setReferenceSource()
    {
        if (null !== $this->info->reference->source) {
            return $this;
        }

        // No source is set, see if we can find a standard match
        $matchAttributes = config('cms-models.analyzer.reference.sources', []);
        
        foreach ($matchAttributes as $matchAttribute) {

            if (array_key_exists($matchAttribute, $this->info->attributes)) {
                $this->info->reference->source = $matchAttribute;
                break;
            }
        }

        return $this;
    }
protected function setReferenceSource()
    {
        if (null !== $this->info->reference->source) {
            return $this;
        }

        // No source is set, see if we can find a standard match
        $matchAttributes = config('cms-models.analyzer.reference.sources', []);
        
        foreach ($matchAttributes as $matchAttribute) {

            if (array_key_exists($matchAttribute, $this->info->attributes)) {
                $this->info->reference->source = $matchAttribute;
                break;
            }
        }

        return $this;
    }
protected function setReferenceSource ( ) { if ( null !== $ this -> info -> reference -> source ) { return $ this ; } // No source is set, see if we can find a standard match $ matchAttributes = config ( 'cms-models.analyzer.reference.sources' , [ ] ) ; foreach ( $ matchAttributes as $ matchAttribute ) { if ( array_key_exists ( $ matchAttribute , $ this -> info -> attributes ) ) { $ this -> info -> reference -> source = $ matchAttribute ; break ; } } return $ this ; }
Sets default reference source, better than primary key, if possible.

@return $this
Sets default reference source better than primary key if possible .