original_string: 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();
      }
code: 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();
      }
code_tokens: 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 ( ) ; }
docstring: Find by username.
  @param  string $username A username.
  @return User           The user.
docstring_tokens: Find by username .