Skip to content
This repository was archived by the owner on Feb 7, 2023. It is now read-only.

Commit 2ce6e3e

Browse files
committed
function to check if a pattern type has a subtype
1 parent e36548a commit 2ce6e3e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

core/lib/PatternLab/PatternData.php

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,21 @@ class PatternData {
3737
public static $rules = array();
3838
public static $dirSep = DIRECTORY_SEPARATOR;
3939

40+
/**
41+
* Check to see if the given pattern type has a pattern subtype associated with it
42+
* @param {String} the name of the pattern
43+
*
44+
* @return {Boolean} if it was found or not
45+
*/
46+
public static function hasPatternSubtype($patternType) {
47+
foreach (self::$store as $patternStoreKey => $patternStoreData) {
48+
if (($patternStoreData["category"] == "patternSubtype") && ($patternStoreData["typeDash"] == $patternType)) {
49+
return true;
50+
}
51+
}
52+
return false;
53+
}
54+
4055
/**
4156
* Gather all of the information related to the patterns
4257
*/

0 commit comments

Comments
 (0)