@@ -57,11 +57,11 @@ public function getRule(int $quotaType, string $userId, array $groups): QuotaRul
5757 )->andWhere (
5858 $ qb ->expr ()->orX (
5959 $ qb ->expr ()->andX (
60- $ qb ->expr ()->eq ('u.entity_type ' , $ qb ->createNamedParameter (' user ' , IQueryBuilder::PARAM_STR )),
60+ $ qb ->expr ()->eq ('u.entity_type ' , $ qb ->createNamedParameter (EntityType:: USER -> value , IQueryBuilder::PARAM_INT )),
6161 $ qb ->expr ()->eq ('u.entity_id ' , $ qb ->createNamedParameter ($ userId , IQueryBuilder::PARAM_STR ))
6262 ),
6363 $ qb ->expr ()->andX (
64- $ qb ->expr ()->eq ('u.entity_type ' , $ qb ->createNamedParameter (' group ' , IQueryBuilder::PARAM_STR )),
64+ $ qb ->expr ()->eq ('u.entity_type ' , $ qb ->createNamedParameter (EntityType:: GROUP -> value , IQueryBuilder::PARAM_INT )),
6565 $ qb ->expr ()->in ('u.entity_id ' , $ qb ->createNamedParameter ($ groups , IQueryBuilder::PARAM_STR_ARRAY ))
6666 ),
6767
@@ -76,11 +76,11 @@ public function getRule(int $quotaType, string $userId, array $groups): QuotaRul
7676 * @param int $quotaType
7777 * @param int $amount
7878 * @param int $priority
79- * @param bool $pool
79+ * @param int $pool
8080 * @return int
8181 * @throws Exception
8282 */
83- public function addRule (int $ quotaType , int $ amount , int $ priority , bool $ pool ): int {
83+ public function addRule (int $ quotaType , int $ amount , int $ priority , int $ pool ): int {
8484 $ qb = $ this ->db ->getQueryBuilder ();
8585
8686 $ qb ->insert ($ this ->getTableName ())
@@ -89,7 +89,7 @@ public function addRule(int $quotaType, int $amount, int $priority, bool $pool):
8989 'type ' => $ qb ->createNamedParameter ($ quotaType , IQueryBuilder::PARAM_INT ),
9090 'amount ' => $ qb ->createNamedParameter ($ amount , IQueryBuilder::PARAM_INT ),
9191 'priority ' => $ qb ->createNamedParameter ($ priority , IQueryBuilder::PARAM_INT ),
92- 'pool ' => $ qb ->createNamedParameter ($ pool , IQueryBuilder::PARAM_BOOL )
92+ 'pool ' => $ qb ->createNamedParameter ($ pool , IQueryBuilder::PARAM_INT )
9393 ]
9494 );
9595 $ qb ->executeStatement ();
@@ -100,18 +100,18 @@ public function addRule(int $quotaType, int $amount, int $priority, bool $pool):
100100 * @param int $quotaType
101101 * @param int $amount
102102 * @param int $priority
103- * @param bool $pool
103+ * @param int $pool
104104 * @return void
105105 * @throws Exception
106106 */
107- public function updateRule (int $ id , int $ quotaType , int $ amount , int $ priority , bool $ pool ): void {
107+ public function updateRule (int $ id , int $ quotaType , int $ amount , int $ priority , int $ pool ): void {
108108 $ qb = $ this ->db ->getQueryBuilder ();
109109
110110 $ qb ->update ($ this ->getTableName ())
111111 ->set ('type ' , $ qb ->createNamedParameter ($ quotaType , IQueryBuilder::PARAM_INT ))
112112 ->set ('amount ' , $ qb ->createNamedParameter ($ amount , IQueryBuilder::PARAM_INT ))
113113 ->set ('priority ' , $ qb ->createNamedParameter ($ priority , IQueryBuilder::PARAM_INT ))
114- ->set ('pool ' , $ qb ->createNamedParameter ($ pool , IQueryBuilder::PARAM_BOOL ))
114+ ->set ('pool ' , $ qb ->createNamedParameter ($ pool , IQueryBuilder::PARAM_INT ))
115115 ->where (
116116 $ qb ->expr ()->eq ('id ' , $ qb ->createNamedParameter ($ id , IQueryBuilder::PARAM_INT ))
117117 );
0 commit comments