Former NBA player Matt Barnes has reportedly been awarded sole physical and legal custody of his twin 10-year-old boys, according to TMZ Sports.

Barnes, who has been at odd with ex-wife Gloria Govan for years, was also granted an 18-month restraining order against his ex-wife, claiming she's a physical danger to him. The restraining order will last until May 2020, according to TMZ, but does not extend to the kids because the judge doesn't believe Gloria poses a danger to them. 

The judge presiding over Thursday's hearing ruled that Govan will still get regular visitation, including every other weekend from Friday until Monday morning, and she is also allowed to have dinner with the kids every Wednesday evening. Barnes, 38, and Govan, 32, are still working out the custody arrangements for the holidays including Christmas, Thanksgiving and New Years. 

Additionally, TMZ reports that Govan was ordered to complete 26 sessions of anger management and 10 parenting classes. She had been arrested the Friday before Labor Day after a confrontation at their sons’ school, in which the twins were left "terrified, screaming hysterically and crying,” according to Barnes.

Per The New York Daily News:

"Barnes said in a signed affidavit that he was attempting to guide one of the boys out of Govan’s Cadillac SUV when she “aggressively jerked the car in reverse,” causing the boy to fall back onto his seat."

"He claimed Govan continued to reverse the vehicle after the child exited the Escalade, causing a heavy door to slam against the boy’s shoulder."

"Barnes said after he walked both boys back to his vehicle, Govan barreled toward him “at an excessively high rate of speed through the school parking lot” to block his exit."