예제 #1
0
 /**
  * Based on the given string, try to find the matching commit.
  *
  * If no user found, simply returns null.
  *
  * @param string Commit
  * @return IDF_Commit or null
  */
 public static function findCommit($string)
 {
     $string = trim($string);
     if (strlen($string) == 0) {
         return null;
     }
     $gc = new IDF_Commit();
     $sql = new Pluf_SQL('scm_id=%s', array($string));
     $gcs = $gc->getList(array('filter' => $sql->gen()));
     if ($gcs->count() > 0) {
         return $gcs[0];
     }
     return null;
 }