LdapTools\Utilities\TSPropertyArray::addTSPropData PHP Method

addTSPropData() protected method

Given the start of TSPropertyArray hex data, and the count for the number of TSProperty structures in contains, parse and split out the individual TSProperty structures. Return the full length of the TSPropertyArray data.
protected addTSPropData ( string $tsPropertyArray, integer $tsPropCount ) : integer
$tsPropertyArray string
$tsPropCount integer
return integer The length of the data in the TSPropertyArray
    protected function addTSPropData($tsPropertyArray, $tsPropCount)
    {
        $length = 0;
        for ($i = 0; $i < $tsPropCount; $i++) {
            // Prop length = name length + value length + type length + the space for the length data.
            $propLength = hexdec(substr($tsPropertyArray, $length, 2)) + hexdec(substr($tsPropertyArray, $length + 2, 2)) * 3 + 6;
            $tsProperty = new TSProperty(hex2bin(substr($tsPropertyArray, $length, $propLength)));
            $this->tsProperty[$tsProperty->getName()] = $tsProperty;
            $length += $propLength;
        }
        return $length;
    }