public static function find_or_create($type, $authenticator, $domain=null)
	{
		$query = self::all()
			->whereEquals('type', $type)
			->whereEquals('authenticator', $authenticator);
		if ($domain)
		{
			$query->whereEquals('domain', $domain);
		}
		$row = $query->row();

		if (!$row || !$row->get('id'))
		{
			$row = self::blank();
			$row->set('type', $type);
			$row->set('authenticator', $authenticator);
			if ($domain)
			{
				$row->set('domain', $domain);
			}
			$row->save();
		}

		if (!$row->get('id'))
		{
			return false;
		}

		return $row;
	}