LdapTools\Utilities\TSPropertyArray::__construct PHP Метод

__construct() публичный Метод

- Pass an array of TSProperty key => value pairs (See DEFAULTS constant). - Pass the TSPropertyArray binary value. The object representation of that will be decoded and constructed. - Pass nothing and a default set of TSProperty key => value pairs will be used (See DEFAULTS constant).
public __construct ( mixed $tsPropertyArray = null )
$tsPropertyArray mixed
    public function __construct($tsPropertyArray = null)
    {
        if (is_null($tsPropertyArray) || is_array($tsPropertyArray)) {
            $tsPropertyArray = $tsPropertyArray ?: self::DEFAULTS;
            foreach ($tsPropertyArray as $key => $value) {
                $tsProperty = new TSProperty();
                $tsProperty->setName($key);
                $tsProperty->setValue($value);
                $this->tsProperty[$key] = $tsProperty;
            }
        } else {
            $this->decode($tsPropertyArray);
        }
    }