<?php
/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */

/**
 * @copyright (c) Kufer Software GmbH, Loisachstrasse 4, D-84453 Mühldorf
 */
class Pruefziffer_A2 implements IPruefziffer
{
  public static function check($pKtoNr, $pBlz, $pGewichtung = array(), $pPruefZifferStelle = 9)
  {
    $result = self::variante1($pKtoNr);
    if (!$result) {
      $result = self::variante2($pKtoNr);
    }

    return $result;
  }

  private static function variante1($pKtoNr)
  {
    $gewichtung = array(0, 2, 1, 2, 1, 2, 1, 2, 1, 2);

    return Pruefziffer_00::check($pKtoNr, null, $gewichtung);
  }

  private static function variante2($pKtoNr)
  {
    $gewichtung = array(0, 2, 3, 4, 5, 6, 7, 2, 3, 4);

    return Pruefziffer_04::check($pKtoNr, null, $gewichtung);
  }
}