PHP Class LdapTools\Utilities\ADTimeSpan

See also: https://technet.microsoft.com/en-us/library/cc753858%28v=ws.10%29.aspx
Author: Chad Sikorra ([email protected])
Show file Open project: ldaptools/ldaptools

Protected Properties

Property Type Description
$days integer
$hours integer
$minutes integer
$never boolean
$seconds integer

Public Methods

Method Description
__construct ( string $time = '' ) Pass the time in I8 format, which is represented in intervals of -100 nanoseconds.
__toString ( ) : string
getDays ( ) : integer Get the days specified for the time span.
getHours ( ) : integer Get the hours specified for the time span.
getInstance ( integer $value, string $unit ) Get an instance of the class based on a specific time unit as the second parameter.
getLdapValue ( ) : string Get the value of all the time units in the format that LDAP expects it in.
getMinutes ( ) : integer Get the minutes specified for the time span.
getNever ( ) : boolean Whether the time span value is considered 'Never'. This is a special value in AD that makes the time span indefinite and is represented by a value of -9223372036854775808.
getSeconds ( ) : integer Get the seconds specified for the time span.
setDays ( integer $days ) Set the days specified for the time span.
setHours ( integer $hours ) Set the hours specified for the time span.
setMinutes ( integer $minutes ) Set the minutes specified for the time span.
setNever ( boolean $value )
setSeconds ( integer $seconds ) Set the seconds specified for the time span.

Protected Methods

Method Description
setAndVerify ( integer $value, string $interval ) Verify the value is an integer and set the correct interval value.
setValuesFromLdap ( integer $time ) Given a time format from LDAP break it down into its individual time units and set them.

Method Details

__construct() public method

Pass the time in I8 format, which is represented in intervals of -100 nanoseconds.
public __construct ( string $time = '' )
$time string

__toString() public method

public __toString ( ) : string
return string

getDays() public method

Get the days specified for the time span.
public getDays ( ) : integer
return integer

getHours() public method

Get the hours specified for the time span.
public getHours ( ) : integer
return integer

getInstance() public static method

Get an instance of the class based on a specific time unit as the second parameter.
public static getInstance ( integer $value, string $unit )
$value integer The time value.
$unit string The time unit. One of the constants of this class: DAYS, HOURS, MINUTES, SECONDS.

getLdapValue() public method

Get the value of all the time units in the format that LDAP expects it in.
public getLdapValue ( ) : string
return string

getMinutes() public method

Get the minutes specified for the time span.
public getMinutes ( ) : integer
return integer

getNever() public method

Whether the time span value is considered 'Never'. This is a special value in AD that makes the time span indefinite and is represented by a value of -9223372036854775808.
public getNever ( ) : boolean
return boolean

getSeconds() public method

Get the seconds specified for the time span.
public getSeconds ( ) : integer
return integer

setAndVerify() protected method

Verify the value is an integer and set the correct interval value.
protected setAndVerify ( integer $value, string $interval )
$value integer
$interval string

setDays() public method

Set the days specified for the time span.
public setDays ( integer $days )
$days integer

setHours() public method

Set the hours specified for the time span.
public setHours ( integer $hours )
$hours integer

setMinutes() public method

Set the minutes specified for the time span.
public setMinutes ( integer $minutes )
$minutes integer

setNever() public method

public setNever ( boolean $value )
$value boolean

setSeconds() public method

Set the seconds specified for the time span.
public setSeconds ( integer $seconds )
$seconds integer

setValuesFromLdap() protected method

Given a time format from LDAP break it down into its individual time units and set them.
protected setValuesFromLdap ( integer $time )
$time integer

Property Details

$days protected property

protected int $days
return integer

$hours protected property

protected int $hours
return integer

$minutes protected property

protected int $minutes
return integer

$never protected property

protected bool $never
return boolean

$seconds protected property

protected int $seconds
return integer