PHP Trait LdapTools\Ldif\LdifStringBuilderTrait

Author: Chad Sikorra ([email protected])
Show file Open project: ldaptools/ldaptools

Protected Properties

Property Type Description
$comments Any comments associated with the entry.
$lineEnding The line ending to use.
$lineFolding Whether or not a value should be folded (continued on the next line) if it goes past $maxLineLength
$maxLineLength The max length for a line before it is folded (if line folding is enabled).

Public Methods

Method Description
addComment ( $comments ) Add a comment to be associated with this entry.
getComments ( ) : string[] Get the comments for this entry.
getLineEnding ( ) : string Get the line ending that will be used.
getLineFolding ( ) : boolean Get whether or not lines exceeding a certain length should be folded (continued on the next line)
getMaxLineLength ( ) : integer Get the max length for a line before the value is folded (continued on the next line).
setLineEnding ( string $lineEnding ) Set the line ending to be used. See the Ldif::LINE_ENDING constant for values.
setLineFolding ( boolean $lineFolding ) Set whether or not lines exceeding a certain length should be folded (continued on the next line)
setMaxLineLength ( integer $length ) Set the max length for a line before the value is folded (continued on the next line).

Protected Methods

Method Description
addCommentsToString ( string $ldif ) : string Add any specified comments to the generated LDIF.
getLdifLine ( string $directive, string $value ) : string Construct a single line of the LDIF for a given directive and value.
getValueForLine ( $value ) : string Gets the value for the line while taking into account any line folding set.

Method Details

addComment() public method

Add a comment to be associated with this entry.
public addComment ( $comments )
$comments

addCommentsToString() protected method

Add any specified comments to the generated LDIF.
protected addCommentsToString ( string $ldif ) : string
$ldif string
return string

getComments() public method

Get the comments for this entry.
public getComments ( ) : string[]
return string[]

getLdifLine() protected method

Construct a single line of the LDIF for a given directive and value.
protected getLdifLine ( string $directive, string $value ) : string
$directive string
$value string
return string

getLineEnding() public method

Get the line ending that will be used.
public getLineEnding ( ) : string
return string

getLineFolding() public method

Get whether or not lines exceeding a certain length should be folded (continued on the next line)
public getLineFolding ( ) : boolean
return boolean

getMaxLineLength() public method

Get the max length for a line before the value is folded (continued on the next line).
public getMaxLineLength ( ) : integer
return integer

getValueForLine() protected method

Gets the value for the line while taking into account any line folding set.
protected getValueForLine ( $value ) : string
$value
return string

setLineEnding() public method

Set the line ending to be used. See the Ldif::LINE_ENDING constant for values.
public setLineEnding ( string $lineEnding )
$lineEnding string

setLineFolding() public method

Set whether or not lines exceeding a certain length should be folded (continued on the next line)
public setLineFolding ( boolean $lineFolding )
$lineFolding boolean

setMaxLineLength() public method

Set the max length for a line before the value is folded (continued on the next line).
public setMaxLineLength ( integer $length )
$length integer

Property Details

$comments protected property

Any comments associated with the entry.
protected $comments

$lineEnding protected property

The line ending to use.
protected $lineEnding

$lineFolding protected property

Whether or not a value should be folded (continued on the next line) if it goes past $maxLineLength
protected $lineFolding

$maxLineLength protected property

The max length for a line before it is folded (if line folding is enabled).
protected $maxLineLength