public function findByUsername($username)
    {
        $qb = $this->createQueryBuilder("u");
        $qb->where("(u.username = :username OR u.email = :email)")
            ->setParameter("username", $username)
            ->setParameter("email", $username);
        $qb->andWhere("u.status = :status")->setParameter("status", 1);
        $qb->setMaxResults(1);
        return $qb->getQuery()->getOneOrNullResult();
    }