File tree Expand file tree Collapse file tree 2 files changed +2
-18
lines changed
Expand file tree Collapse file tree 2 files changed +2
-18
lines changed Original file line number Diff line number Diff line change @@ -914,22 +914,6 @@ public function getSubItemtype() {
914914 return $ this ->question ->fields ['itemtype ' ];
915915 }
916916
917- /**
918- * Get the itemtype of the item to show for the given values
919- *
920- * @param string $values json or raw string
921- *
922- * @return string
923- */
924- public static function getSubItemtypeForValues ($ values ) {
925- $ decodedValues = json_decode ($ values , JSON_OBJECT_AS_ARRAY );
926- if ($ decodedValues === null ) {
927- return $ values ;
928- }
929-
930- return $ decodedValues ['itemtype ' ];
931- }
932-
933917 /**
934918 * get HTML code to show entity restriction policy
935919 * @return string HTML code
Original file line number Diff line number Diff line change @@ -212,7 +212,7 @@ public function getAvailableValues(): array {
212212
213213 public function equals ($ value ): bool {
214214 $ value = html_entity_decode ($ value );
215- $ itemtype = $ this ->getSubItemtypeForValues ( $ this -> question -> fields [ ' values ' ] );
215+ $ itemtype = $ this ->getSubItemtype ( );
216216 $ item = new $ itemtype ();
217217 if ($ item ->isNewId ($ this ->value )) {
218218 return ($ value === '' );
@@ -229,7 +229,7 @@ public function notEquals($value): bool {
229229
230230 public function greaterThan ($ value ): bool {
231231 $ value = html_entity_decode ($ value );
232- $ itemtype = $ this ->getSubItemtypeForValues ( $ this -> question -> fields [ ' values ' ] );
232+ $ itemtype = $ this ->getSubItemtype ( );
233233 $ item = new $ itemtype ();
234234 if (!$ item ->getFromDB ($ this ->value )) {
235235 throw new ComparisonException ('Item not found for comparison ' );
You can’t perform that action at this time.
0 commit comments