コード例 #1
0
ファイル: Threads.php プロジェクト: Rikuforever/wiki
 private static function assertSingularity($threads, $attribute, $value)
 {
     if (count($threads) == 0) {
         return null;
     }
     if (count($threads) == 1) {
         return array_pop($threads);
     }
     if (count($threads) > 1) {
         Threads::databaseError("More than one thread with {$attribute} = {$value}.");
     }
     return null;
 }