-
Notifications
You must be signed in to change notification settings - Fork 0
/
Zooomr.Photosets.RuleSet.PeopleTags.php
46 lines (38 loc) · 1.42 KB
/
Zooomr.Photosets.RuleSet.PeopleTags.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
#This work is licenced under http://creativecommons.org/licenses/GPL/2.0/
include_once 'Zooomr.Photosets.RuleSet.php';
# A PeopleTag rule for a photoset
class ZooomrPhotosetsRuleSetPeopleTags extends ZooomrPhotosetsRuleSetBase
{
# Constructor
#
# Required Parameters:
# * match_test - one the provided constants above
# * people_tags - array of people tags to test against
#
# Returns:
# * a new object to be added to the ZooomrPhotosetRuleSet object
#
function ZooomrPhotosetsRuleSetPeopleTags($a_parameter_hash)
{
include 'Zooomr.Constants.php';
$required_params = array('match_test', 'people_tags');
ZooomrPhotosetsRuleSet::params_are_valid($required_params, null, $a_parameter_hash);
if (
($a_parameter_hash['match_test'] != $PEOPLETAG_MATCHALLOF) and
($a_parameter_hash['match_test'] != $PEOPLETAG_MATCHANYOF) and
($a_parameter_hash['match_test'] != $PEOPLETAG_MATCHNONEOF)
)
{
throw new Exception("ZooomrPhotosetsRuleSetPeopleTags: a_match constant not a recognised value");
}
if (!(is_array($a_parameter_hash['people_tags'])))
{
throw new Exception("ZooomrPhotosetsRuleSetPeopleTags: match_args must be an array");
}
$this->match_test = $a_parameter_hash['match_test'];
$this->match_type = $PHOTOSETMATCH_PEOPLETAG;
$this->match_args = join(",", $a_parameter_hash['people_tags']);
}
}
?>