Edgar signed for Burnley from Newcastle United in the summer of 2009 from Newcastle United but had to wait until January 2010 for his league debut when he came in to face Manchester United at Old Trafford in the Premier League.
He did well that day, but a couple of difficult games followed and for the remainder of the season, and much of the next season, he failed to make his mark at Turf Moor. During that first season he went out on loan to Swansea and would have done so again a year later but for some FIFA red tape.
He, somewhat surprisingly, was named in the team for the last game of last season but it was certainly a foretaste of things to come. He didn't feature in our opening game of this season against Watford or the next home game against Cardiff, but he's played in every other game with all but two of them starts.
After some concerning performances earlier in the season he's definitely become a much better player with a run of games behind him and that has seen him rewarded with this new deal.
Manager Eddie Howe said: "I think it's a reward for his performances and also his attitude and how he has conducted himself.
"He has shown a real willingness to improve on the training pitch, which is so important to us. I think he will only continue to get better and I think potentially he could be a real asset to this football club."
He added: "David has had a good season. He has got better and better. He is a young footballing centre-half who previous to this season had not had many games or opportunities.
"We've continually picked him, which I think speaks volumes for his performances of late, especially where he has formed a good partnership with Ben and with Michael.
"Hopefully he will just get better and better and continue to develop in the way that we want. I think the good thing about David is that he is a terrific footballer and he really suits how we are trying to go in terms of playing out from the back.
"Hopefully, though, this isn't the end. We don't want David to take a backward step now. We want him to get even better and his aim should be to try and be my first choice centre-half."