code: public function findOneBy(array $criteria = [])
      {
          $result = iterator_to_array($this->findBy($criteria));
  
          if (!empty($result)) {
              $result = array_shift($result);
          }
  
          return $result;
      }
docs: @param array $criteria
  
  @return array