Ejemplo n.º 1
0
 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;
 }