-
Notifications
You must be signed in to change notification settings - Fork 0
/
Zooomr.Photosets.RuleSet.DateUploaded.php
39 lines (31 loc) · 1.16 KB
/
Zooomr.Photosets.RuleSet.DateUploaded.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
<?php
#This work is licenced under http://creativecommons.org/licenses/GPL/2.0/
include_once 'Zooomr.Photosets.RuleSet.php';
# DateUploaded rule for a photoset
class ZooomrPhotosetsRuleSetDateUploaded extends ZooomrPhotosetsRuleSetBase
{
# Constructor
#
# Required Parameters:
# * date - Ruby date object
#
# Returns:
# * a new object to be added to the ZooomrPhotosetRuleSet object
#
function ZooomrPhotosetsRuleSetDateUploaded($a_parameter_hash)
{
include 'Zooomr.Constants.php';
$required_params = array('min_date');
ZooomrPhotosetsRuleSet::params_are_valid($required_params, null, $a_parameter_hash);
if (!(is_a($a_parameter_hash['min_date'], 'DateTime')))
{
throw new Exception("zooomr.photos.recentlyUpdated requires a DateTime object for min_date");
}
// nt mktime ([ int $hour [, int $minute [, int $second [, int $month [, int $day [, int $year [, int $is_dst ]]]]]]] )
$unixtime = date_format($a_parameter_hash['min_date'], "U");
$this->match_test = "0"; # no match test for Date Uploaded
$this->match_type = $PHOTOSETMATCH_DATEUPLOADED;
$this->match_args = $unixtime;
}
}
?>