public static function isUnique($id, $attr, $attr_value)
    {
        $obj = self::first(array($attr => $attr_value));
        return $obj==null || $obj->get(self::getPK()) == $id;
    }
public static function isUnique($id, $attr, $attr_value)
    {
        $obj = self::first(array($attr => $attr_value));
        return $obj==null || $obj->get(self::getPK()) == $id;
    }
public static function isUnique ( $ id , $ attr , $ attr_value ) { $ obj = self :: first ( array ( $ attr => $ attr_value ) ) ; return $ obj == null || $ obj -> get ( self :: getPK ( ) ) == $ id ; }
Check if attribute is unique

@param mixed $id         id
@param mixed $attr       to check
@param mixed $attr_value to check

@return if attribute is unique
Check if attribute is unique