<commit_before><commit_msg>Create categorymapper.php<commit_after><?php
namespace OCA\Passwords\Db;

use OCP\IDb;
use OCP\AppFramework\Db\Mapper;

class CategoryMapper extends Mapper {

	public function __construct(IDb $db) {
		parent::__construct($db, 'passwords_categories', '\OCA\Passwords\Db\Category');
	}

	public function find($id, $userId) {
		$sql = 'SELECT * FROM *PREFIX*passwords_categories WHERE id = ? AND user_id = ?';
		return $this->findEntity($sql, [$id, $userId]);
	}

	public function findAll($userId) {
		$sql = 'SELECT * FROM *PREFIX*passwords_categories WHERE user_id = ? ORDER BY LOWER(category_name) COLLATE utf8_general_ci ASC';
		return $this->findEntities($sql, [$userId]);
	}
}

{'fraction_non_alphanumeric': 0.14285714285714285, 'fraction_numerical': 0.0014144271570014145, 'mean_word_length': 5.679245283018868, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3179203', 'n_tokens_mistral': 247, 'n_tokens_neox': 240, 'n_words': 53}