public static function getAllOneToOneRelationshipsForModelBySourceColumnName($modelClassName)
    {
        $relationships = self::getAllRelationshipsForModel($modelClassName);
        $columnRelationships = [];

        foreach ($relationships as $relationship) {
            if ($relationship instanceof OneToOne) {
                $columnName = $relationship->getSourceColumnName();

                $columnRelationships[$columnName] = $relationship;
            }
        }

        return $columnRelationships;
    }
public static function getAllOneToOneRelationshipsForModelBySourceColumnName($modelClassName)
    {
        $relationships = self::getAllRelationshipsForModel($modelClassName);
        $columnRelationships = [];

        foreach ($relationships as $relationship) {
            if ($relationship instanceof OneToOne) {
                $columnName = $relationship->getSourceColumnName();

                $columnRelationships[$columnName] = $relationship;
            }
        }

        return $columnRelationships;
    }
public static function getAllOneToOneRelationshipsForModelBySourceColumnName ( $ modelClassName ) { $ relationships = self :: getAllRelationshipsForModel ( $ modelClassName ) ; $ columnRelationships = [ ] ; foreach ( $ relationships as $ relationship ) { if ( $ relationship instanceof OneToOne ) { $ columnName = $ relationship -> getSourceColumnName ( ) ; $ columnRelationships [ $ columnName ] = $ relationship ; } } return $ columnRelationships ; }
Gets all the one to one relationships for a model in an array keyed by the column name in the source model.

@param  $modelClassName
@return OneToOne[]
Gets all the one to one relationships for a model in an array keyed by the column name in the source model .