id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
28,000 | ldaptools/ldaptools | src/LdapTools/Query/Operator/BaseOperator.php | BaseOperator.getWasConverterUsed | public function getWasConverterUsed($alias = null)
{
if ($alias) {
return isset($this->converterAliasUsed[$alias]) ? $this->converterAliasUsed[$alias] : false;
} else {
return $this->converterUsed;
}
} | php | public function getWasConverterUsed($alias = null)
{
if ($alias) {
return isset($this->converterAliasUsed[$alias]) ? $this->converterAliasUsed[$alias] : false;
} else {
return $this->converterUsed;
}
} | [
"public",
"function",
"getWasConverterUsed",
"(",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"alias",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"converterAliasUsed",
"[",
"$",
"alias",
"]",
")",
"?",
"$",
"this",
"->",
"converterAl... | Get whether a converter was used or not.
@param string|null $alias
@return bool | [
"Get",
"whether",
"a",
"converter",
"was",
"used",
"or",
"not",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L296-L303 |
28,001 | ldaptools/ldaptools | src/LdapTools/Query/Operator/BaseOperator.php | BaseOperator.toLdapFilter | public function toLdapFilter($alias = null)
{
if ($this->skipFilterForAlias($alias)) {
return '';
}
if ($this->getValueForQuery($alias) instanceof BaseOperator) {
return $this->getValueForQuery($alias)->toLdapFilter($alias);
}
return self::SEPARATOR_S... | php | public function toLdapFilter($alias = null)
{
if ($this->skipFilterForAlias($alias)) {
return '';
}
if ($this->getValueForQuery($alias) instanceof BaseOperator) {
return $this->getValueForQuery($alias)->toLdapFilter($alias);
}
return self::SEPARATOR_S... | [
"public",
"function",
"toLdapFilter",
"(",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"skipFilterForAlias",
"(",
"$",
"alias",
")",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"getValueForQuery",
"(",
"$"... | Returns the operator translated to its LDAP filter string value.
@param string|null $alias
@return string | [
"Returns",
"the",
"operator",
"translated",
"to",
"its",
"LDAP",
"filter",
"string",
"value",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L311-L325 |
28,002 | ldaptools/ldaptools | src/LdapTools/Query/Operator/BaseOperator.php | BaseOperator.getAttributeToQuery | protected function getAttributeToQuery($alias)
{
$attribute = $this->getTranslatedAttribute($alias) ?: $this->getAttribute();
// This avoids possible LDAP injection from unverified input for an attribute name.
if (!LdapUtilities::isValidAttributeFormat($attribute)) {
throw new L... | php | protected function getAttributeToQuery($alias)
{
$attribute = $this->getTranslatedAttribute($alias) ?: $this->getAttribute();
// This avoids possible LDAP injection from unverified input for an attribute name.
if (!LdapUtilities::isValidAttributeFormat($attribute)) {
throw new L... | [
"protected",
"function",
"getAttributeToQuery",
"(",
"$",
"alias",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"getTranslatedAttribute",
"(",
"$",
"alias",
")",
"?",
":",
"$",
"this",
"->",
"getAttribute",
"(",
")",
";",
"// This avoids possible LDAP i... | This will get the translated attribute or just the attribute if no schema translation was done.
@param null|string $alias
@return string
@throws LdapQueryException | [
"This",
"will",
"get",
"the",
"translated",
"attribute",
"or",
"just",
"the",
"attribute",
"if",
"no",
"schema",
"translation",
"was",
"done",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L334-L344 |
28,003 | ldaptools/ldaptools | src/LdapTools/Query/Operator/BaseOperator.php | BaseOperator.getValueForQuery | protected function getValueForQuery($alias)
{
$value = $this->getConvertedValue($alias);
return is_null($value) ? $this->getValue() : $value;
} | php | protected function getValueForQuery($alias)
{
$value = $this->getConvertedValue($alias);
return is_null($value) ? $this->getValue() : $value;
} | [
"protected",
"function",
"getValueForQuery",
"(",
"$",
"alias",
")",
"{",
"$",
"value",
"=",
"$",
"this",
"->",
"getConvertedValue",
"(",
"$",
"alias",
")",
";",
"return",
"is_null",
"(",
"$",
"value",
")",
"?",
"$",
"this",
"->",
"getValue",
"(",
")",... | Depending on whether a converter was used, get the value that should be used for the query.
@param null|string $alias
@return mixed | [
"Depending",
"on",
"whether",
"a",
"converter",
"was",
"used",
"get",
"the",
"value",
"that",
"should",
"be",
"used",
"for",
"the",
"query",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/Operator/BaseOperator.php#L352-L357 |
28,004 | ldaptools/ldaptools | src/LdapTools/Factory/HydratorFactory.php | HydratorFactory.get | public function get($hydratorType)
{
if (self::TO_ARRAY == $hydratorType) {
return new ArrayHydrator();
} elseif (self::TO_OBJECT == $hydratorType) {
return new LdapObjectHydrator();
} else {
throw new InvalidArgumentException(sprintf('Unknown hydrator typ... | php | public function get($hydratorType)
{
if (self::TO_ARRAY == $hydratorType) {
return new ArrayHydrator();
} elseif (self::TO_OBJECT == $hydratorType) {
return new LdapObjectHydrator();
} else {
throw new InvalidArgumentException(sprintf('Unknown hydrator typ... | [
"public",
"function",
"get",
"(",
"$",
"hydratorType",
")",
"{",
"if",
"(",
"self",
"::",
"TO_ARRAY",
"==",
"$",
"hydratorType",
")",
"{",
"return",
"new",
"ArrayHydrator",
"(",
")",
";",
"}",
"elseif",
"(",
"self",
"::",
"TO_OBJECT",
"==",
"$",
"hydra... | Get the hydrator by its type.
@param string $hydratorType
@return \LdapTools\Hydrator\HydratorInterface | [
"Get",
"the",
"hydrator",
"by",
"its",
"type",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Factory/HydratorFactory.php#L40-L49 |
28,005 | ldaptools/ldaptools | src/LdapTools/DomainConfiguration.php | DomainConfiguration.setLdapType | public function setLdapType($ldapType)
{
if (!defined('\LdapTools\Connection\LdapConnection::TYPE_'.strtoupper($ldapType))) {
throw new InvalidArgumentException(sprintf('Invalid LDAP type "%s".', $ldapType));
}
$this->config['ldapType'] = strtolower($ldapType);
return $t... | php | public function setLdapType($ldapType)
{
if (!defined('\LdapTools\Connection\LdapConnection::TYPE_'.strtoupper($ldapType))) {
throw new InvalidArgumentException(sprintf('Invalid LDAP type "%s".', $ldapType));
}
$this->config['ldapType'] = strtolower($ldapType);
return $t... | [
"public",
"function",
"setLdapType",
"(",
"$",
"ldapType",
")",
"{",
"if",
"(",
"!",
"defined",
"(",
"'\\LdapTools\\Connection\\LdapConnection::TYPE_'",
".",
"strtoupper",
"(",
"$",
"ldapType",
")",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
... | Set the LDAP type for this domain.
@param string $ldapType The LDAP type.
@return $this | [
"Set",
"the",
"LDAP",
"type",
"for",
"this",
"domain",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/DomainConfiguration.php#L359-L367 |
28,006 | ldaptools/ldaptools | src/LdapTools/DomainConfiguration.php | DomainConfiguration.load | public function load(array $config)
{
$config = $this->getParsedConfig(
$config,
$this->config,
$this->yamlConfigMap,
$this->required
);
$this->setParsedConfig($config);
return $this;
} | php | public function load(array $config)
{
$config = $this->getParsedConfig(
$config,
$this->config,
$this->yamlConfigMap,
$this->required
);
$this->setParsedConfig($config);
return $this;
} | [
"public",
"function",
"load",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getParsedConfig",
"(",
"$",
"config",
",",
"$",
"this",
"->",
"config",
",",
"$",
"this",
"->",
"yamlConfigMap",
",",
"$",
"this",
"->",
"req... | Load a configuration from an array of values. The keys must be the same name as their YAML config
names.
@param array $config
@return $this
@throws ConfigurationException | [
"Load",
"a",
"configuration",
"from",
"an",
"array",
"of",
"values",
".",
"The",
"keys",
"must",
"be",
"the",
"same",
"name",
"as",
"their",
"YAML",
"config",
"names",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/DomainConfiguration.php#L613-L624 |
28,007 | ldaptools/ldaptools | src/LdapTools/DomainConfiguration.php | DomainConfiguration.isParsedConfigValid | protected function isParsedConfigValid(array $config)
{
$inConfig = count(array_intersect_key(array_flip($this->required), $config));
return $inConfig === count($this->required);
} | php | protected function isParsedConfigValid(array $config)
{
$inConfig = count(array_intersect_key(array_flip($this->required), $config));
return $inConfig === count($this->required);
} | [
"protected",
"function",
"isParsedConfigValid",
"(",
"array",
"$",
"config",
")",
"{",
"$",
"inConfig",
"=",
"count",
"(",
"array_intersect_key",
"(",
"array_flip",
"(",
"$",
"this",
"->",
"required",
")",
",",
"$",
"config",
")",
")",
";",
"return",
"$",
... | Checks whether all required values for the configuration have been set.
@param array $config
@return bool | [
"Checks",
"whether",
"all",
"required",
"values",
"for",
"the",
"configuration",
"have",
"been",
"set",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/DomainConfiguration.php#L632-L637 |
28,008 | ldaptools/ldaptools | src/LdapTools/DomainConfiguration.php | DomainConfiguration.validateInteger | protected function validateInteger($value, $name)
{
if (filter_var($value, FILTER_VALIDATE_INT) === false) {
throw new InvalidArgumentException(sprintf("The %s should be an integer.", $name));
}
return $value;
} | php | protected function validateInteger($value, $name)
{
if (filter_var($value, FILTER_VALIDATE_INT) === false) {
throw new InvalidArgumentException(sprintf("The %s should be an integer.", $name));
}
return $value;
} | [
"protected",
"function",
"validateInteger",
"(",
"$",
"value",
",",
"$",
"name",
")",
"{",
"if",
"(",
"filter_var",
"(",
"$",
"value",
",",
"FILTER_VALIDATE_INT",
")",
"===",
"false",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",... | This is a helper since an integer could simply be passed as a string, which is still valid.
@param mixed $value
@param string $name
@return int | [
"This",
"is",
"a",
"helper",
"since",
"an",
"integer",
"could",
"simply",
"be",
"passed",
"as",
"a",
"string",
"which",
"is",
"still",
"valid",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/DomainConfiguration.php#L646-L653 |
28,009 | ldaptools/ldaptools | src/LdapTools/Schema/LdapObjectSchema.php | LdapObjectSchema.setAttributeMap | public function setAttributeMap(array $attributeMap)
{
$this->attributeMap = $attributeMap;
$this->lcAttributeNameMap = array_change_key_case($attributeMap);
$this->lcAttributeValueMap = array_map('strtolower', $attributeMap);
} | php | public function setAttributeMap(array $attributeMap)
{
$this->attributeMap = $attributeMap;
$this->lcAttributeNameMap = array_change_key_case($attributeMap);
$this->lcAttributeValueMap = array_map('strtolower', $attributeMap);
} | [
"public",
"function",
"setAttributeMap",
"(",
"array",
"$",
"attributeMap",
")",
"{",
"$",
"this",
"->",
"attributeMap",
"=",
"$",
"attributeMap",
";",
"$",
"this",
"->",
"lcAttributeNameMap",
"=",
"array_change_key_case",
"(",
"$",
"attributeMap",
")",
";",
"... | Set the map of names to actual LDAP attribute names.
@param array $attributeMap | [
"Set",
"the",
"map",
"of",
"names",
"to",
"actual",
"LDAP",
"attribute",
"names",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/LdapObjectSchema.php#L169-L174 |
28,010 | ldaptools/ldaptools | src/LdapTools/Schema/LdapObjectSchema.php | LdapObjectSchema.getConverter | public function getConverter($attributeName)
{
if (!$this->hasConverter($attributeName)) {
throw new InvalidArgumentException(sprintf('No converter exists for attribute "%s".', $attributeName));
}
return $this->lcConverterMap[strtolower($attributeName)];
} | php | public function getConverter($attributeName)
{
if (!$this->hasConverter($attributeName)) {
throw new InvalidArgumentException(sprintf('No converter exists for attribute "%s".', $attributeName));
}
return $this->lcConverterMap[strtolower($attributeName)];
} | [
"public",
"function",
"getConverter",
"(",
"$",
"attributeName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasConverter",
"(",
"$",
"attributeName",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'No converter exists for att... | Get the name of the converter for an attribute.
@param string $attributeName
@return string | [
"Get",
"the",
"name",
"of",
"the",
"converter",
"for",
"an",
"attribute",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/LdapObjectSchema.php#L224-L231 |
28,011 | ldaptools/ldaptools | src/LdapTools/Schema/LdapObjectSchema.php | LdapObjectSchema.getAttributeToLdap | public function getAttributeToLdap($attribute)
{
return $this->hasAttribute($attribute) ? $this->lcAttributeNameMap[strtolower($attribute)] : $attribute;
} | php | public function getAttributeToLdap($attribute)
{
return $this->hasAttribute($attribute) ? $this->lcAttributeNameMap[strtolower($attribute)] : $attribute;
} | [
"public",
"function",
"getAttributeToLdap",
"(",
"$",
"attribute",
")",
"{",
"return",
"$",
"this",
"->",
"hasAttribute",
"(",
"$",
"attribute",
")",
"?",
"$",
"this",
"->",
"lcAttributeNameMap",
"[",
"strtolower",
"(",
"$",
"attribute",
")",
"]",
":",
"$"... | Given an attribute name, this will get the attribute that LDAP is expecting for that name.
@param string $attribute
@return string | [
"Given",
"an",
"attribute",
"name",
"this",
"will",
"get",
"the",
"attribute",
"that",
"LDAP",
"is",
"expecting",
"for",
"that",
"name",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/LdapObjectSchema.php#L333-L336 |
28,012 | ldaptools/ldaptools | src/LdapTools/Schema/LdapObjectSchema.php | LdapObjectSchema.setConverterOptions | public function setConverterOptions($converter, $attribute, array $converterOptions)
{
if (!isset($this->converterOptions[$converter])) {
$this->converterOptions[$converter] = [];
}
$this->converterOptions[$converter][strtolower($attribute)] = $converterOptions;
} | php | public function setConverterOptions($converter, $attribute, array $converterOptions)
{
if (!isset($this->converterOptions[$converter])) {
$this->converterOptions[$converter] = [];
}
$this->converterOptions[$converter][strtolower($attribute)] = $converterOptions;
} | [
"public",
"function",
"setConverterOptions",
"(",
"$",
"converter",
",",
"$",
"attribute",
",",
"array",
"$",
"converterOptions",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"converterOptions",
"[",
"$",
"converter",
"]",
")",
")",
"{",
"$... | Set any options to be passed to specific converters.
@param string $converter
@param string $attribute
@param array $converterOptions | [
"Set",
"any",
"options",
"to",
"be",
"passed",
"to",
"specific",
"converters",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/LdapObjectSchema.php#L465-L471 |
28,013 | ldaptools/ldaptools | src/LdapTools/Schema/LdapObjectSchema.php | LdapObjectSchema.getConverterOptions | public function getConverterOptions($converter, $attribute)
{
$lcAttr = strtolower($attribute);
$options = [];
if (isset($this->converterOptions[$converter]) && isset($this->converterOptions[$converter][$lcAttr])) {
$options = $this->converterOptions[$converter][$lcAttr];
... | php | public function getConverterOptions($converter, $attribute)
{
$lcAttr = strtolower($attribute);
$options = [];
if (isset($this->converterOptions[$converter]) && isset($this->converterOptions[$converter][$lcAttr])) {
$options = $this->converterOptions[$converter][$lcAttr];
... | [
"public",
"function",
"getConverterOptions",
"(",
"$",
"converter",
",",
"$",
"attribute",
")",
"{",
"$",
"lcAttr",
"=",
"strtolower",
"(",
"$",
"attribute",
")",
";",
"$",
"options",
"=",
"[",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"c... | Get the array of converter options for a specific converter and attribute.
@param string $converter
@param string $attribute
@return array | [
"Get",
"the",
"array",
"of",
"converter",
"options",
"for",
"a",
"specific",
"converter",
"and",
"attribute",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Schema/LdapObjectSchema.php#L480-L490 |
28,014 | ldaptools/ldaptools | src/LdapTools/Ldif/Entry/LdifEntryAdd.php | LdifEntryAdd.addAttribute | public function addAttribute($attribute, $value)
{
$value = is_array($value) ? $value : [$value];
if (!isset($this->attributes[$attribute])) {
$this->attributes[$attribute] = [];
}
foreach ($value as $attrValue) {
$this->attributes[$attribute][] = $attrValue;... | php | public function addAttribute($attribute, $value)
{
$value = is_array($value) ? $value : [$value];
if (!isset($this->attributes[$attribute])) {
$this->attributes[$attribute] = [];
}
foreach ($value as $attrValue) {
$this->attributes[$attribute][] = $attrValue;... | [
"public",
"function",
"addAttribute",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"$",
"value",
"=",
"is_array",
"(",
"$",
"value",
")",
"?",
"$",
"value",
":",
"[",
"$",
"value",
"]",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",... | Add an attribute that will be added to the entry going to LDAP.
@param string $attribute
@param mixed $value
@return $this | [
"Add",
"an",
"attribute",
"that",
"will",
"be",
"added",
"to",
"the",
"entry",
"going",
"to",
"LDAP",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Entry/LdifEntryAdd.php#L62-L74 |
28,015 | ldaptools/ldaptools | src/LdapTools/Ldif/Entry/LdifEntryAdd.php | LdifEntryAdd.setAttributes | public function setAttributes(array $attributes)
{
$this->attributes = [];
foreach ($attributes as $attribute => $value) {
$this->addAttribute($attribute, $value);
}
return $this;
} | php | public function setAttributes(array $attributes)
{
$this->attributes = [];
foreach ($attributes as $attribute => $value) {
$this->addAttribute($attribute, $value);
}
return $this;
} | [
"public",
"function",
"setAttributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"this",
"->",
"attributes",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"attribute",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"addAttri... | Set the attributes that will be added to the entry going to LDAP.
@param array $attributes
@return $this | [
"Set",
"the",
"attributes",
"that",
"will",
"be",
"added",
"to",
"the",
"entry",
"going",
"to",
"LDAP",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Entry/LdifEntryAdd.php#L82-L90 |
28,016 | ldaptools/ldaptools | src/LdapTools/Security/FlagsSddlTrait.php | FlagsSddlTrait.getShortNames | public function getShortNames()
{
$names = [];
$used = [];
foreach (static::SHORT_NAME as $name => $value) {
if ($this->has($value) && !in_array($value, $used)) {
$names[] = $name;
$used[] = $value;
}
}
return $names;
... | php | public function getShortNames()
{
$names = [];
$used = [];
foreach (static::SHORT_NAME as $name => $value) {
if ($this->has($value) && !in_array($value, $used)) {
$names[] = $name;
$used[] = $value;
}
}
return $names;
... | [
"public",
"function",
"getShortNames",
"(",
")",
"{",
"$",
"names",
"=",
"[",
"]",
";",
"$",
"used",
"=",
"[",
"]",
";",
"foreach",
"(",
"static",
"::",
"SHORT_NAME",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
... | Get the short names used in SDDL.
@return array | [
"Get",
"the",
"short",
"names",
"used",
"in",
"SDDL",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/FlagsSddlTrait.php#L27-L40 |
28,017 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeNameResolver.php | AttributeNameResolver.toLdap | public function toLdap(array $entry)
{
$toLdap = [];
foreach ($entry as $attribute => $value) {
$toLdap[$this->schema->getAttributeToLdap($attribute)] = $value;
}
return $toLdap;
} | php | public function toLdap(array $entry)
{
$toLdap = [];
foreach ($entry as $attribute => $value) {
$toLdap[$this->schema->getAttributeToLdap($attribute)] = $value;
}
return $toLdap;
} | [
"public",
"function",
"toLdap",
"(",
"array",
"$",
"entry",
")",
"{",
"$",
"toLdap",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"entry",
"as",
"$",
"attribute",
"=>",
"$",
"value",
")",
"{",
"$",
"toLdap",
"[",
"$",
"this",
"->",
"schema",
"->",
"g... | Convert values to LDAP.
@param array $entry The LDAP entry.
@return array | [
"Convert",
"values",
"to",
"LDAP",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeNameResolver.php#L73-L82 |
28,018 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeNameResolver.php | AttributeNameResolver.arraySearchGetValue | public static function arraySearchGetValue($needle, array $haystack)
{
$lcNeedle = strtolower($needle);
foreach ($haystack as $value) {
if ($lcNeedle == strtolower($value)) {
return $value;
}
}
return null;
} | php | public static function arraySearchGetValue($needle, array $haystack)
{
$lcNeedle = strtolower($needle);
foreach ($haystack as $value) {
if ($lcNeedle == strtolower($value)) {
return $value;
}
}
return null;
} | [
"public",
"static",
"function",
"arraySearchGetValue",
"(",
"$",
"needle",
",",
"array",
"$",
"haystack",
")",
"{",
"$",
"lcNeedle",
"=",
"strtolower",
"(",
"$",
"needle",
")",
";",
"foreach",
"(",
"$",
"haystack",
"as",
"$",
"value",
")",
"{",
"if",
"... | Given an array value determine if it exists in the array and return the value as it is in the array.
@param string $needle
@param array $haystack
@return string|null | [
"Given",
"an",
"array",
"value",
"determine",
"if",
"it",
"exists",
"in",
"the",
"array",
"and",
"return",
"the",
"value",
"as",
"it",
"is",
"in",
"the",
"array",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeNameResolver.php#L91-L102 |
28,019 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeNameResolver.php | AttributeNameResolver.addDnFromLdapIfNotPresent | protected function addDnFromLdapIfNotPresent(array $newEntry, array $entry)
{
if (!isset($newEntry['dn']) && isset($entry['dn'])) {
$newEntry['dn'] = $entry['dn'];
}
return $newEntry;
} | php | protected function addDnFromLdapIfNotPresent(array $newEntry, array $entry)
{
if (!isset($newEntry['dn']) && isset($entry['dn'])) {
$newEntry['dn'] = $entry['dn'];
}
return $newEntry;
} | [
"protected",
"function",
"addDnFromLdapIfNotPresent",
"(",
"array",
"$",
"newEntry",
",",
"array",
"$",
"entry",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"newEntry",
"[",
"'dn'",
"]",
")",
"&&",
"isset",
"(",
"$",
"entry",
"[",
"'dn'",
"]",
")",
... | The DN attribute is returned by PHP on all LDAP search operations, regardless of selected attributes, and is used
in many functions. So add it to the results even if it wasn't selected for.
@param array $newEntry
@param array $entry
@return array | [
"The",
"DN",
"attribute",
"is",
"returned",
"by",
"PHP",
"on",
"all",
"LDAP",
"search",
"operations",
"regardless",
"of",
"selected",
"attributes",
"and",
"is",
"used",
"in",
"many",
"functions",
".",
"So",
"add",
"it",
"to",
"the",
"results",
"even",
"if"... | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeNameResolver.php#L112-L119 |
28,020 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeNameResolver.php | AttributeNameResolver.selectedButNotPartOfEntry | protected function selectedButNotPartOfEntry($attribute, array $entry)
{
$lcAttribute = strtolower($attribute);
$inSelectedAttributes = in_array($lcAttribute, array_map('strtolower', $this->selectedAttributes));
$existsInEntry = array_key_exists($lcAttribute, array_change_key_case($entry));... | php | protected function selectedButNotPartOfEntry($attribute, array $entry)
{
$lcAttribute = strtolower($attribute);
$inSelectedAttributes = in_array($lcAttribute, array_map('strtolower', $this->selectedAttributes));
$existsInEntry = array_key_exists($lcAttribute, array_change_key_case($entry));... | [
"protected",
"function",
"selectedButNotPartOfEntry",
"(",
"$",
"attribute",
",",
"array",
"$",
"entry",
")",
"{",
"$",
"lcAttribute",
"=",
"strtolower",
"(",
"$",
"attribute",
")",
";",
"$",
"inSelectedAttributes",
"=",
"in_array",
"(",
"$",
"lcAttribute",
",... | Check whether the attribute name was selected to be returned but is not yet part of the entry. Adjusts the check
to be case insensitive.
@param string $attribute
@param array $entry
@return bool | [
"Check",
"whether",
"the",
"attribute",
"name",
"was",
"selected",
"to",
"be",
"returned",
"but",
"is",
"not",
"yet",
"part",
"of",
"the",
"entry",
".",
"Adjusts",
"the",
"check",
"to",
"be",
"case",
"insensitive",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeNameResolver.php#L129-L137 |
28,021 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeNameResolver.php | AttributeNameResolver.setMappedNames | protected function setMappedNames(array $newEntry, $attribute, $value)
{
// Get all names mapped to this LDAP attribute name...
if (!$this->schema->hasNamesMappedToAttribute($attribute)) {
return $newEntry;
}
$mappedNames = $this->schema->getNamesMappedToAttribute($attri... | php | protected function setMappedNames(array $newEntry, $attribute, $value)
{
// Get all names mapped to this LDAP attribute name...
if (!$this->schema->hasNamesMappedToAttribute($attribute)) {
return $newEntry;
}
$mappedNames = $this->schema->getNamesMappedToAttribute($attri... | [
"protected",
"function",
"setMappedNames",
"(",
"array",
"$",
"newEntry",
",",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"// Get all names mapped to this LDAP attribute name...",
"if",
"(",
"!",
"$",
"this",
"->",
"schema",
"->",
"hasNamesMappedToAttribute",
"(... | Set all the names mapped to a single attribute from LDAP. This helps account for multiple mappings used for
different purposes.
@param array $newEntry
@param string $attribute
@param array|string $value
@return mixed | [
"Set",
"all",
"the",
"names",
"mapped",
"to",
"a",
"single",
"attribute",
"from",
"LDAP",
".",
"This",
"helps",
"account",
"for",
"multiple",
"mappings",
"used",
"for",
"different",
"purposes",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeNameResolver.php#L148-L164 |
28,022 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeNameResolver.php | AttributeNameResolver.getSelectedAttributes | protected function getSelectedAttributes(array $selected, array $entry)
{
if (count($selected) === 1 && $selected[0] == '*' && !$this->schema) {
$selected = array_keys($entry);
} elseif (count($selected) === 1 && $selected[0] == '*' && $this->schema) {
$selected = array_uniqu... | php | protected function getSelectedAttributes(array $selected, array $entry)
{
if (count($selected) === 1 && $selected[0] == '*' && !$this->schema) {
$selected = array_keys($entry);
} elseif (count($selected) === 1 && $selected[0] == '*' && $this->schema) {
$selected = array_uniqu... | [
"protected",
"function",
"getSelectedAttributes",
"(",
"array",
"$",
"selected",
",",
"array",
"$",
"entry",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"selected",
")",
"===",
"1",
"&&",
"$",
"selected",
"[",
"0",
"]",
"==",
"'*'",
"&&",
"!",
"$",
"this... | Determine what attributes should be selected. This accounts for a query wanting all attributes.
@param array $selected
@param array $entry
@return array | [
"Determine",
"what",
"attributes",
"should",
"be",
"selected",
".",
"This",
"accounts",
"for",
"a",
"query",
"wanting",
"all",
"attributes",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeNameResolver.php#L173-L182 |
28,023 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.parse | public function parse($ldif)
{
$ldifObject = new Ldif();
$this->setup($ldif);
while (!$this->isEndOfLdif()) {
if ($this->isComment()) {
$this->addCommentToQueueOrLdif($ldifObject);
$this->nextLine();
} elseif ($this->isStartOfEntry()) ... | php | public function parse($ldif)
{
$ldifObject = new Ldif();
$this->setup($ldif);
while (!$this->isEndOfLdif()) {
if ($this->isComment()) {
$this->addCommentToQueueOrLdif($ldifObject);
$this->nextLine();
} elseif ($this->isStartOfEntry()) ... | [
"public",
"function",
"parse",
"(",
"$",
"ldif",
")",
"{",
"$",
"ldifObject",
"=",
"new",
"Ldif",
"(",
")",
";",
"$",
"this",
"->",
"setup",
"(",
"$",
"ldif",
")",
";",
"while",
"(",
"!",
"$",
"this",
"->",
"isEndOfLdif",
"(",
")",
")",
"{",
"i... | Parses a string containing LDIF data and returns an object with the entries it contains.
@param string $ldif
@return Ldif
@throws LdifParserException | [
"Parses",
"a",
"string",
"containing",
"LDIF",
"data",
"and",
"returns",
"an",
"object",
"with",
"the",
"entries",
"it",
"contains",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L102-L125 |
28,024 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.parseEntry | protected function parseEntry()
{
$entry = $this->parseCommonDirectives($this->getKeyAndValue($this->currentLine())[1]);
if (!empty($this->commentQueue)) {
$entry->addComment(...$this->commentQueue);
$this->commentQueue = [];
}
// Nothing further to do with ... | php | protected function parseEntry()
{
$entry = $this->parseCommonDirectives($this->getKeyAndValue($this->currentLine())[1]);
if (!empty($this->commentQueue)) {
$entry->addComment(...$this->commentQueue);
$this->commentQueue = [];
}
// Nothing further to do with ... | [
"protected",
"function",
"parseEntry",
"(",
")",
"{",
"$",
"entry",
"=",
"$",
"this",
"->",
"parseCommonDirectives",
"(",
"$",
"this",
"->",
"getKeyAndValue",
"(",
"$",
"this",
"->",
"currentLine",
"(",
")",
")",
"[",
"1",
"]",
")",
";",
"if",
"(",
"... | Parse an entry from the DN position until we reach the start of the next entry. Return the entry that was parsed.
@return LdifEntryInterface | [
"Parse",
"an",
"entry",
"from",
"the",
"DN",
"position",
"until",
"we",
"reach",
"the",
"start",
"of",
"the",
"next",
"entry",
".",
"Return",
"the",
"entry",
"that",
"was",
"parsed",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L183-L211 |
28,025 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.getLdifEntryObject | protected function getLdifEntryObject($dn, $changeType)
{
if (!array_key_exists($changeType, $this->changeTypeMap)) {
$this->throwException(sprintf('The changetype "%s" is invalid', $changeType));
}
return new $this->changeTypeMap[$changeType]($dn);
} | php | protected function getLdifEntryObject($dn, $changeType)
{
if (!array_key_exists($changeType, $this->changeTypeMap)) {
$this->throwException(sprintf('The changetype "%s" is invalid', $changeType));
}
return new $this->changeTypeMap[$changeType]($dn);
} | [
"protected",
"function",
"getLdifEntryObject",
"(",
"$",
"dn",
",",
"$",
"changeType",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"changeType",
",",
"$",
"this",
"->",
"changeTypeMap",
")",
")",
"{",
"$",
"this",
"->",
"throwException",
"(",
... | Get the LdifEntry for the changetype.
@param string $dn
@param string $changeType
@return LdifEntryInterface
@throws LdifParserException | [
"Get",
"the",
"LdifEntry",
"for",
"the",
"changetype",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L265-L272 |
28,026 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.startsWith | protected function startsWith($value, $line = null)
{
if (is_null($line)) {
$line = $this->currentLine();
}
return (substr($line, 0, strlen($value)) === $value);
} | php | protected function startsWith($value, $line = null)
{
if (is_null($line)) {
$line = $this->currentLine();
}
return (substr($line, 0, strlen($value)) === $value);
} | [
"protected",
"function",
"startsWith",
"(",
"$",
"value",
",",
"$",
"line",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"line",
")",
")",
"{",
"$",
"line",
"=",
"$",
"this",
"->",
"currentLine",
"(",
")",
";",
"}",
"return",
"(",
"subs... | Check if the current line starts with a specific value.
@param string $value
@param null|string $line
@return bool | [
"Check",
"if",
"the",
"current",
"line",
"starts",
"with",
"a",
"specific",
"value",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L310-L317 |
28,027 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.getContinuedValues | protected function getContinuedValues($value)
{
while ($this->isContinuedValue($this->nextLine(false))) {
$value .= substr($this->nextLine(), 1);
}
return $value;
} | php | protected function getContinuedValues($value)
{
while ($this->isContinuedValue($this->nextLine(false))) {
$value .= substr($this->nextLine(), 1);
}
return $value;
} | [
"protected",
"function",
"getContinuedValues",
"(",
"$",
"value",
")",
"{",
"while",
"(",
"$",
"this",
"->",
"isContinuedValue",
"(",
"$",
"this",
"->",
"nextLine",
"(",
"false",
")",
")",
")",
"{",
"$",
"value",
".=",
"substr",
"(",
"$",
"this",
"->",... | Check for any continued values and concatenate them into one.
@param $value
@return string | [
"Check",
"for",
"any",
"continued",
"values",
"and",
"concatenate",
"them",
"into",
"one",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L419-L426 |
28,028 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.getValueFromUrl | protected function getValueFromUrl($url)
{
$type = substr($url, 0, strpos($url, Ldif::KEY_VALUE_SEPARATOR));
if (!$this->hasUrlLoader($type)) {
$this->throwException(sprintf('Cannot find a URL loader for type "%s"', $type));
}
try {
return $this->urlLoaders[... | php | protected function getValueFromUrl($url)
{
$type = substr($url, 0, strpos($url, Ldif::KEY_VALUE_SEPARATOR));
if (!$this->hasUrlLoader($type)) {
$this->throwException(sprintf('Cannot find a URL loader for type "%s"', $type));
}
try {
return $this->urlLoaders[... | [
"protected",
"function",
"getValueFromUrl",
"(",
"$",
"url",
")",
"{",
"$",
"type",
"=",
"substr",
"(",
"$",
"url",
",",
"0",
",",
"strpos",
"(",
"$",
"url",
",",
"Ldif",
"::",
"KEY_VALUE_SEPARATOR",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->"... | Get the value of the URL data via a UrlLoader.
@param string $url
@return string | [
"Get",
"the",
"value",
"of",
"the",
"URL",
"data",
"via",
"a",
"UrlLoader",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L434-L447 |
28,029 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.getLdapControl | protected function getLdapControl($value)
{
$values = explode(' ', $value);
// This should never happen, but it seems better to cover it in case...
if (empty($values) || $values === false) {
$this->throwException(sprintf('Expecting a LDAP control but got "%s"', $value));
... | php | protected function getLdapControl($value)
{
$values = explode(' ', $value);
// This should never happen, but it seems better to cover it in case...
if (empty($values) || $values === false) {
$this->throwException(sprintf('Expecting a LDAP control but got "%s"', $value));
... | [
"protected",
"function",
"getLdapControl",
"(",
"$",
"value",
")",
"{",
"$",
"values",
"=",
"explode",
"(",
"' '",
",",
"$",
"value",
")",
";",
"// This should never happen, but it seems better to cover it in case...",
"if",
"(",
"empty",
"(",
"$",
"values",
")",
... | Validate a control directive and get the value for the control and the criticality.
@param string $value
@return LdapControl
@throws LdifParserException | [
"Validate",
"a",
"control",
"directive",
"and",
"get",
"the",
"value",
"for",
"the",
"control",
"and",
"the",
"criticality",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L520-L542 |
28,030 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.getBoolFromStringBool | protected function getBoolFromStringBool($value)
{
if (!($value == 'true' || $value == 'false')) {
$this->throwException(sprintf('Expected "true" or "false" but got %s', $value));
}
return $value === 'true' ? true : false;
} | php | protected function getBoolFromStringBool($value)
{
if (!($value == 'true' || $value == 'false')) {
$this->throwException(sprintf('Expected "true" or "false" but got %s', $value));
}
return $value === 'true' ? true : false;
} | [
"protected",
"function",
"getBoolFromStringBool",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"value",
"==",
"'true'",
"||",
"$",
"value",
"==",
"'false'",
")",
")",
"{",
"$",
"this",
"->",
"throwException",
"(",
"sprintf",
"(",
"'Expected \"t... | Convert an expected string "true" or "false" to bool.
@param string $value
@return bool
@throws LdifParserException | [
"Convert",
"an",
"expected",
"string",
"true",
"or",
"false",
"to",
"bool",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L615-L622 |
28,031 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.getBoolFromStringInt | protected function getBoolFromStringInt($value)
{
if (!($value == '0' || $value == '1')) {
$this->throwException(sprintf('Expected "0" or "1" but got: %s', $value));
}
return (bool) $value;
} | php | protected function getBoolFromStringInt($value)
{
if (!($value == '0' || $value == '1')) {
$this->throwException(sprintf('Expected "0" or "1" but got: %s', $value));
}
return (bool) $value;
} | [
"protected",
"function",
"getBoolFromStringInt",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"value",
"==",
"'0'",
"||",
"$",
"value",
"==",
"'1'",
")",
")",
"{",
"$",
"this",
"->",
"throwException",
"(",
"sprintf",
"(",
"'Expected \"0\" or \"... | Convert an expected string "0" or "1" to bool.
@param string $value
@return bool
@throws LdifParserException | [
"Convert",
"an",
"expected",
"string",
"0",
"or",
"1",
"to",
"bool",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L631-L638 |
28,032 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifParser.php | LdifParser.addCommentToQueueOrLdif | protected function addCommentToQueueOrLdif(Ldif $ldif)
{
$comment = $this->getContinuedValues(substr($this->currentLine(), 1));
// Remove the single space from the start of a comment, but leave the others intact.
if ($this->startsWith(' ', $comment)) {
$comment = substr($comment... | php | protected function addCommentToQueueOrLdif(Ldif $ldif)
{
$comment = $this->getContinuedValues(substr($this->currentLine(), 1));
// Remove the single space from the start of a comment, but leave the others intact.
if ($this->startsWith(' ', $comment)) {
$comment = substr($comment... | [
"protected",
"function",
"addCommentToQueueOrLdif",
"(",
"Ldif",
"$",
"ldif",
")",
"{",
"$",
"comment",
"=",
"$",
"this",
"->",
"getContinuedValues",
"(",
"substr",
"(",
"$",
"this",
"->",
"currentLine",
"(",
")",
",",
"1",
")",
")",
";",
"// Remove the si... | Determine whether the comment should be added to the LDIF itself, or if it's a comment for an entry within the
LDIF. If it's for an entry in the LDIF, then we make the assumption that we an empty line separates comments
between the LDIF comments overall and the start of a comment for an entry. This seems like the most ... | [
"Determine",
"whether",
"the",
"comment",
"should",
"be",
"added",
"to",
"the",
"LDIF",
"itself",
"or",
"if",
"it",
"s",
"a",
"comment",
"for",
"an",
"entry",
"within",
"the",
"LDIF",
".",
"If",
"it",
"s",
"for",
"an",
"entry",
"in",
"the",
"LDIF",
"... | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifParser.php#L659-L678 |
28,033 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.has | public function has($attribute, $value = null)
{
if (!array_key_exists(strtolower($attribute), array_change_key_case($this->attributes))) {
return false;
}
return is_null($value) ?: $this->attributeHasValue($attribute, $value);
} | php | public function has($attribute, $value = null)
{
if (!array_key_exists(strtolower($attribute), array_change_key_case($this->attributes))) {
return false;
}
return is_null($value) ?: $this->attributeHasValue($attribute, $value);
} | [
"public",
"function",
"has",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"strtolower",
"(",
"$",
"attribute",
")",
",",
"array_change_key_case",
"(",
"$",
"this",
"->",
"attributes",
")",
")",... | Check to see if a specific attribute exists. Optionally check if it exists with a specific value.
@param string $attribute
@param mixed $value
@return bool | [
"Check",
"to",
"see",
"if",
"a",
"specific",
"attribute",
"exists",
".",
"Optionally",
"check",
"if",
"it",
"exists",
"with",
"a",
"specific",
"value",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L90-L97 |
28,034 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.get | public function get($attribute, $default = null)
{
return $this->has($attribute) ? array_change_key_case($this->attributes)[strtolower($attribute)] : $default;
} | php | public function get($attribute, $default = null)
{
return $this->has($attribute) ? array_change_key_case($this->attributes)[strtolower($attribute)] : $default;
} | [
"public",
"function",
"get",
"(",
"$",
"attribute",
",",
"$",
"default",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"has",
"(",
"$",
"attribute",
")",
"?",
"array_change_key_case",
"(",
"$",
"this",
"->",
"attributes",
")",
"[",
"strtolower",
... | Get the value of an attribute. An attribute with multiple values will return an array of values. If the attribute
does not exist it will return null by default. Pass an optional default value to return something other than null.
@param string $attribute
@param mixed $default
@return mixed | [
"Get",
"the",
"value",
"of",
"an",
"attribute",
".",
"An",
"attribute",
"with",
"multiple",
"values",
"will",
"return",
"an",
"array",
"of",
"values",
".",
"If",
"the",
"attribute",
"does",
"not",
"exist",
"it",
"will",
"return",
"null",
"by",
"default",
... | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L107-L110 |
28,035 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.reset | public function reset(...$attributes)
{
foreach ($attributes as $attribute) {
if ($this->has($attribute)) {
$attribute = $this->resolveAttributeName($attribute);
unset($this->attributes[$attribute]);
}
$this->batches->add(new Batch(Batch::T... | php | public function reset(...$attributes)
{
foreach ($attributes as $attribute) {
if ($this->has($attribute)) {
$attribute = $this->resolveAttributeName($attribute);
unset($this->attributes[$attribute]);
}
$this->batches->add(new Batch(Batch::T... | [
"public",
"function",
"reset",
"(",
"...",
"$",
"attributes",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"attribute",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"attribute",
")",
")",
"{",
"$",
"attribute",
"=",
"$",
"thi... | Resets the attribute, which effectively removes any values it may have.
@param string[] ...$attributes
@return $this | [
"Resets",
"the",
"attribute",
"which",
"effectively",
"removes",
"any",
"values",
"it",
"may",
"have",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L164-L175 |
28,036 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.add | public function add($attribute, ...$values)
{
foreach ($values as $value) {
if ($this->has($attribute)) {
$attribute = $this->resolveAttributeName($attribute);
$this->attributes[$attribute] = $this->addAttributeValue($this->attributes[$attribute], $value);
... | php | public function add($attribute, ...$values)
{
foreach ($values as $value) {
if ($this->has($attribute)) {
$attribute = $this->resolveAttributeName($attribute);
$this->attributes[$attribute] = $this->addAttributeValue($this->attributes[$attribute], $value);
... | [
"public",
"function",
"add",
"(",
"$",
"attribute",
",",
"...",
"$",
"values",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"attribute",
")",
")",
"{",
"$",
"attribute",
"="... | Add an additional value, or values, to an attribute.
@param string $attribute
@param mixed[] ...$values
@return $this | [
"Add",
"an",
"additional",
"value",
"or",
"values",
"to",
"an",
"attribute",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L184-L197 |
28,037 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.attributeHasValue | protected function attributeHasValue($attribute, $value)
{
$attribute = $this->resolveAttributeName($attribute);
if (is_array($this->attributes[$attribute])) {
return in_array($value, $this->attributes[$attribute]);
} else {
return ($this->attributes[$attribute] == $... | php | protected function attributeHasValue($attribute, $value)
{
$attribute = $this->resolveAttributeName($attribute);
if (is_array($this->attributes[$attribute])) {
return in_array($value, $this->attributes[$attribute]);
} else {
return ($this->attributes[$attribute] == $... | [
"protected",
"function",
"attributeHasValue",
"(",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"$",
"attribute",
"=",
"$",
"this",
"->",
"resolveAttributeName",
"(",
"$",
"attribute",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"attributes"... | Check if an attribute has a specific value. Called only when the attribute is known to exist already.
@param string $attribute
@param mixed $value
@return bool | [
"Check",
"if",
"an",
"attribute",
"has",
"a",
"specific",
"value",
".",
"Called",
"only",
"when",
"the",
"attribute",
"is",
"known",
"to",
"exist",
"already",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L322-L331 |
28,038 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.resolveAttributeName | protected function resolveAttributeName($attribute)
{
$result = preg_grep("/^$attribute$/i", array_keys($this->attributes));
if (empty($result)) {
throw new InvalidArgumentException(sprintf('Unable to resolve attribute "%s".', $attribute));
}
return reset($result);
} | php | protected function resolveAttributeName($attribute)
{
$result = preg_grep("/^$attribute$/i", array_keys($this->attributes));
if (empty($result)) {
throw new InvalidArgumentException(sprintf('Unable to resolve attribute "%s".', $attribute));
}
return reset($result);
} | [
"protected",
"function",
"resolveAttributeName",
"(",
"$",
"attribute",
")",
"{",
"$",
"result",
"=",
"preg_grep",
"(",
"\"/^$attribute$/i\"",
",",
"array_keys",
"(",
"$",
"this",
"->",
"attributes",
")",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"result",
"... | Retrieve the attribute in the case it exists in the array.
@param string $attribute
@return string | [
"Retrieve",
"the",
"attribute",
"in",
"the",
"case",
"it",
"exists",
"in",
"the",
"array",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L339-L347 |
28,039 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.removeAttributeValue | protected function removeAttributeValue($value, $valueToRemove)
{
$valueToRemove = is_array($valueToRemove) ? $valueToRemove : [ $valueToRemove ];
foreach ($valueToRemove as $remove) {
if (is_array($value) && (($key = array_search($remove, $value)) !== false)) {
unset($v... | php | protected function removeAttributeValue($value, $valueToRemove)
{
$valueToRemove = is_array($valueToRemove) ? $valueToRemove : [ $valueToRemove ];
foreach ($valueToRemove as $remove) {
if (is_array($value) && (($key = array_search($remove, $value)) !== false)) {
unset($v... | [
"protected",
"function",
"removeAttributeValue",
"(",
"$",
"value",
",",
"$",
"valueToRemove",
")",
"{",
"$",
"valueToRemove",
"=",
"is_array",
"(",
"$",
"valueToRemove",
")",
"?",
"$",
"valueToRemove",
":",
"[",
"$",
"valueToRemove",
"]",
";",
"foreach",
"(... | Given the original value, remove if it's present.
@param mixed $value
@param mixed $valueToRemove
@return mixed | [
"Given",
"the",
"original",
"value",
"remove",
"if",
"it",
"s",
"present",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L356-L369 |
28,040 | ldaptools/ldaptools | src/LdapTools/Object/LdapObject.php | LdapObject.addAttributeValue | protected function addAttributeValue($value, $valueToAdd)
{
$valueToAdd = is_array($valueToAdd) ? $valueToAdd : [ $valueToAdd ];
$value = is_array($value) ? $value : [ $value ];
return array_merge($value, $valueToAdd);
} | php | protected function addAttributeValue($value, $valueToAdd)
{
$valueToAdd = is_array($valueToAdd) ? $valueToAdd : [ $valueToAdd ];
$value = is_array($value) ? $value : [ $value ];
return array_merge($value, $valueToAdd);
} | [
"protected",
"function",
"addAttributeValue",
"(",
"$",
"value",
",",
"$",
"valueToAdd",
")",
"{",
"$",
"valueToAdd",
"=",
"is_array",
"(",
"$",
"valueToAdd",
")",
"?",
"$",
"valueToAdd",
":",
"[",
"$",
"valueToAdd",
"]",
";",
"$",
"value",
"=",
"is_arra... | Adds an additional value to an existing LDAP attribute value.
@param mixed $value
@param mixed $valueToAdd
@return array | [
"Adds",
"an",
"additional",
"value",
"to",
"an",
"existing",
"LDAP",
"attribute",
"value",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Object/LdapObject.php#L378-L384 |
28,041 | ldaptools/ldaptools | src/LdapTools/Operation/QueryOperation.php | QueryOperation.setScope | public function setScope($scope)
{
if (!in_array($scope, self::SCOPE)) {
throw new LdapQueryException(sprintf(
'Scope type "%s" is invalid. See the QueryOperation::SCOPE[] constant for valid types.', $scope
));
}
$this->properties['scope'] = $scope;
... | php | public function setScope($scope)
{
if (!in_array($scope, self::SCOPE)) {
throw new LdapQueryException(sprintf(
'Scope type "%s" is invalid. See the QueryOperation::SCOPE[] constant for valid types.', $scope
));
}
$this->properties['scope'] = $scope;
... | [
"public",
"function",
"setScope",
"(",
"$",
"scope",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"scope",
",",
"self",
"::",
"SCOPE",
")",
")",
"{",
"throw",
"new",
"LdapQueryException",
"(",
"sprintf",
"(",
"'Scope type \"%s\" is invalid. See the QueryOpe... | Set the scope for the LDAP query operation.
@param $scope
@return $this
@throws LdapQueryException | [
"Set",
"the",
"scope",
"for",
"the",
"LDAP",
"query",
"operation",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Operation/QueryOperation.php#L135-L145 |
28,042 | ldaptools/ldaptools | src/LdapTools/Enums/AD/ResponseCode.php | ResponseCode.getMessageForError | public static function getMessageForError($value)
{
if (self::isValidName($value)) {
$value = self::getNameValue($value);
}
return isset(self::$messages[$value]) ? self::$messages[$value] : null;
} | php | public static function getMessageForError($value)
{
if (self::isValidName($value)) {
$value = self::getNameValue($value);
}
return isset(self::$messages[$value]) ? self::$messages[$value] : null;
} | [
"public",
"static",
"function",
"getMessageForError",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"self",
"::",
"isValidName",
"(",
"$",
"value",
")",
")",
"{",
"$",
"value",
"=",
"self",
"::",
"getNameValue",
"(",
"$",
"value",
")",
";",
"}",
"return",
... | Get the helpful error message for a specific error if it exists.
@param mixed $value
@return string|null | [
"Get",
"the",
"helpful",
"error",
"message",
"for",
"a",
"specific",
"error",
"if",
"it",
"exists",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Enums/AD/ResponseCode.php#L144-L151 |
28,043 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifStringBuilderTrait.php | LdifStringBuilderTrait.addCommentsToString | protected function addCommentsToString($ldif)
{
foreach ($this->comments as $comment) {
$ldif .= Ldif::COMMENT.' '.$this->getValueForLine($comment).$this->lineEnding;
}
return $ldif;
} | php | protected function addCommentsToString($ldif)
{
foreach ($this->comments as $comment) {
$ldif .= Ldif::COMMENT.' '.$this->getValueForLine($comment).$this->lineEnding;
}
return $ldif;
} | [
"protected",
"function",
"addCommentsToString",
"(",
"$",
"ldif",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"comments",
"as",
"$",
"comment",
")",
"{",
"$",
"ldif",
".=",
"Ldif",
"::",
"COMMENT",
".",
"' '",
".",
"$",
"this",
"->",
"getValueForLine",
... | Add any specified comments to the generated LDIF.
@param string $ldif
@return string | [
"Add",
"any",
"specified",
"comments",
"to",
"the",
"generated",
"LDIF",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifStringBuilderTrait.php#L145-L152 |
28,044 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifStringBuilderTrait.php | LdifStringBuilderTrait.getLdifLine | protected function getLdifLine($directive, $value)
{
$separator = Ldif::KEY_VALUE_SEPARATOR;
// Per the RFC, any value starting with a space should be base64 encoded
if ((substr($value, 0, strlen(' ')) === ' ')) {
$separator .= Ldif::KEY_VALUE_SEPARATOR;
$value = bas... | php | protected function getLdifLine($directive, $value)
{
$separator = Ldif::KEY_VALUE_SEPARATOR;
// Per the RFC, any value starting with a space should be base64 encoded
if ((substr($value, 0, strlen(' ')) === ' ')) {
$separator .= Ldif::KEY_VALUE_SEPARATOR;
$value = bas... | [
"protected",
"function",
"getLdifLine",
"(",
"$",
"directive",
",",
"$",
"value",
")",
"{",
"$",
"separator",
"=",
"Ldif",
"::",
"KEY_VALUE_SEPARATOR",
";",
"// Per the RFC, any value starting with a space should be base64 encoded",
"if",
"(",
"(",
"substr",
"(",
"$",... | Construct a single line of the LDIF for a given directive and value.
@param string $directive
@param string $value
@return string | [
"Construct",
"a",
"single",
"line",
"of",
"the",
"LDIF",
"for",
"a",
"given",
"directive",
"and",
"value",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifStringBuilderTrait.php#L161-L172 |
28,045 | ldaptools/ldaptools | src/LdapTools/Ldif/LdifStringBuilderTrait.php | LdifStringBuilderTrait.getValueForLine | protected function getValueForLine($value)
{
/**
* Is this the correct way to do line folding? If a folded line starts/ends with a space should the value,
* and this every line, be base64 encoded? Reading the RFC this does not seem clear.
*/
if ($this->lineFolding) {
... | php | protected function getValueForLine($value)
{
/**
* Is this the correct way to do line folding? If a folded line starts/ends with a space should the value,
* and this every line, be base64 encoded? Reading the RFC this does not seem clear.
*/
if ($this->lineFolding) {
... | [
"protected",
"function",
"getValueForLine",
"(",
"$",
"value",
")",
"{",
"/**\n * Is this the correct way to do line folding? If a folded line starts/ends with a space should the value,\n * and this every line, be base64 encoded? Reading the RFC this does not seem clear.\n */... | Gets the value for the line while taking into account any line folding set.
@param $value
@return string | [
"Gets",
"the",
"value",
"for",
"the",
"line",
"while",
"taking",
"into",
"account",
"any",
"line",
"folding",
"set",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/LdifStringBuilderTrait.php#L180-L194 |
28,046 | ldaptools/ldaptools | src/LdapTools/Utilities/MBString.php | MBString.ord | public static function ord($string)
{
if (self::isMbstringLoaded()) {
$result = unpack('N', mb_convert_encoding($string, 'UCS-4BE', 'UTF-8'));
if (is_array($result) === true) {
return $result[1];
}
}
return ord($string);
} | php | public static function ord($string)
{
if (self::isMbstringLoaded()) {
$result = unpack('N', mb_convert_encoding($string, 'UCS-4BE', 'UTF-8'));
if (is_array($result) === true) {
return $result[1];
}
}
return ord($string);
} | [
"public",
"static",
"function",
"ord",
"(",
"$",
"string",
")",
"{",
"if",
"(",
"self",
"::",
"isMbstringLoaded",
"(",
")",
")",
"{",
"$",
"result",
"=",
"unpack",
"(",
"'N'",
",",
"mb_convert_encoding",
"(",
"$",
"string",
",",
"'UCS-4BE'",
",",
"'UTF... | Get the integer value of a specific character.
@param $string
@return int | [
"Get",
"the",
"integer",
"value",
"of",
"a",
"specific",
"character",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/MBString.php#L42-L52 |
28,047 | ldaptools/ldaptools | src/LdapTools/Utilities/MBString.php | MBString.compare | public static function compare($value1, $value2)
{
if (self::isIntlLoaded()) {
return self::getCollator()->compare($value1, $value2);
}
return strnatcmp($value1, $value2);
} | php | public static function compare($value1, $value2)
{
if (self::isIntlLoaded()) {
return self::getCollator()->compare($value1, $value2);
}
return strnatcmp($value1, $value2);
} | [
"public",
"static",
"function",
"compare",
"(",
"$",
"value1",
",",
"$",
"value2",
")",
"{",
"if",
"(",
"self",
"::",
"isIntlLoaded",
"(",
")",
")",
"{",
"return",
"self",
"::",
"getCollator",
"(",
")",
"->",
"compare",
"(",
"$",
"value1",
",",
"$",
... | Performs a comparison between two values and returns an integer result, like strnatcmp.
@param string $value1
@param string $value2
@return int | [
"Performs",
"a",
"comparison",
"between",
"two",
"values",
"and",
"returns",
"an",
"integer",
"result",
"like",
"strnatcmp",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/MBString.php#L87-L94 |
28,048 | ldaptools/ldaptools | src/LdapTools/Utilities/MBString.php | MBString.array_change_value_case | public static function array_change_value_case(array $values)
{
$newValues = [];
foreach ($values as $key => $value) {
$newValues[$key] = self::strtolower($value);
}
return $newValues;
} | php | public static function array_change_value_case(array $values)
{
$newValues = [];
foreach ($values as $key => $value) {
$newValues[$key] = self::strtolower($value);
}
return $newValues;
} | [
"public",
"static",
"function",
"array_change_value_case",
"(",
"array",
"$",
"values",
")",
"{",
"$",
"newValues",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"values",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"newValues",
"[",
"$",
"key",
... | Change the values in an array to lower-case values.
@param array $values
@return array | [
"Change",
"the",
"values",
"in",
"an",
"array",
"to",
"lower",
"-",
"case",
"values",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/MBString.php#L117-L126 |
28,049 | ldaptools/ldaptools | src/LdapTools/Security/SecurityDescriptor.php | SecurityDescriptor.setOwner | public function setOwner($owner)
{
$this->owner = $owner instanceof SID ? $owner : new SID($owner);
return $this;
} | php | public function setOwner($owner)
{
$this->owner = $owner instanceof SID ? $owner : new SID($owner);
return $this;
} | [
"public",
"function",
"setOwner",
"(",
"$",
"owner",
")",
"{",
"$",
"this",
"->",
"owner",
"=",
"$",
"owner",
"instanceof",
"SID",
"?",
"$",
"owner",
":",
"new",
"SID",
"(",
"$",
"owner",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set the owner SID for the security descriptor.
@param SID|string $owner
@return $this | [
"Set",
"the",
"owner",
"SID",
"for",
"the",
"security",
"descriptor",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/SecurityDescriptor.php#L133-L138 |
28,050 | ldaptools/ldaptools | src/LdapTools/Security/SecurityDescriptor.php | SecurityDescriptor.setGroup | public function setGroup($group)
{
$this->group = $group instanceof SID ? $group : new SID($group);
return $this;
} | php | public function setGroup($group)
{
$this->group = $group instanceof SID ? $group : new SID($group);
return $this;
} | [
"public",
"function",
"setGroup",
"(",
"$",
"group",
")",
"{",
"$",
"this",
"->",
"group",
"=",
"$",
"group",
"instanceof",
"SID",
"?",
"$",
"group",
":",
"new",
"SID",
"(",
"$",
"group",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set the group SID for the security descriptor.
@param SID|string $group
@return $this | [
"Set",
"the",
"group",
"SID",
"for",
"the",
"security",
"descriptor",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/SecurityDescriptor.php#L156-L161 |
28,051 | ldaptools/ldaptools | src/LdapTools/Security/SecurityDescriptor.php | SecurityDescriptor.setDacl | public function setDacl(Dacl $dacl = null)
{
$this->dacl = $dacl;
return $this->toggleAclPresent((bool) $dacl, Dacl::SDDL_CHAR);
} | php | public function setDacl(Dacl $dacl = null)
{
$this->dacl = $dacl;
return $this->toggleAclPresent((bool) $dacl, Dacl::SDDL_CHAR);
} | [
"public",
"function",
"setDacl",
"(",
"Dacl",
"$",
"dacl",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"dacl",
"=",
"$",
"dacl",
";",
"return",
"$",
"this",
"->",
"toggleAclPresent",
"(",
"(",
"bool",
")",
"$",
"dacl",
",",
"Dacl",
"::",
"SDDL_CHAR",
... | Set the Discretionary ACL.
@param Dacl $dacl
@return $this | [
"Set",
"the",
"Discretionary",
"ACL",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/SecurityDescriptor.php#L189-L194 |
28,052 | ldaptools/ldaptools | src/LdapTools/Security/SecurityDescriptor.php | SecurityDescriptor.setSacl | public function setSacl(Sacl $sacl = null)
{
$this->sacl = $sacl;
return $this->toggleAclPresent((bool) $sacl, Sacl::SDDL_CHAR);
} | php | public function setSacl(Sacl $sacl = null)
{
$this->sacl = $sacl;
return $this->toggleAclPresent((bool) $sacl, Sacl::SDDL_CHAR);
} | [
"public",
"function",
"setSacl",
"(",
"Sacl",
"$",
"sacl",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"sacl",
"=",
"$",
"sacl",
";",
"return",
"$",
"this",
"->",
"toggleAclPresent",
"(",
"(",
"bool",
")",
"$",
"sacl",
",",
"Sacl",
"::",
"SDDL_CHAR",
... | Set the System ACL.
@param Sacl $sacl
@return $this | [
"Set",
"the",
"System",
"ACL",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/SecurityDescriptor.php#L212-L217 |
28,053 | ldaptools/ldaptools | src/LdapTools/Security/SecurityDescriptor.php | SecurityDescriptor.toBinary | public function toBinary($canonicalize = true)
{
$offsetOwner = 0;
$offsetGroup = 0;
$offsetDacl = 0;
$offsetSacl = 0;
$owner = $this->owner ? $this->owner->toBinary() : null;
$group = $this->group ? $this->group->toBinary() : null;
$dacl = $this->dacl ? $this... | php | public function toBinary($canonicalize = true)
{
$offsetOwner = 0;
$offsetGroup = 0;
$offsetDacl = 0;
$offsetSacl = 0;
$owner = $this->owner ? $this->owner->toBinary() : null;
$group = $this->group ? $this->group->toBinary() : null;
$dacl = $this->dacl ? $this... | [
"public",
"function",
"toBinary",
"(",
"$",
"canonicalize",
"=",
"true",
")",
"{",
"$",
"offsetOwner",
"=",
"0",
";",
"$",
"offsetGroup",
"=",
"0",
";",
"$",
"offsetDacl",
"=",
"0",
";",
"$",
"offsetSacl",
"=",
"0",
";",
"$",
"owner",
"=",
"$",
"th... | Get the binary string form of the security descriptor.
@param bool $canonicalize Whether or not to canonicalize the DACL
@return string | [
"Get",
"the",
"binary",
"string",
"form",
"of",
"the",
"security",
"descriptor",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/SecurityDescriptor.php#L225-L269 |
28,054 | ldaptools/ldaptools | src/LdapTools/Security/SecurityDescriptor.php | SecurityDescriptor.toSddl | public function toSddl($canonicalize = true)
{
// These will always be present in the SDDL...
$sddl = 'O:'.($this->owner->getShortName() ?: $this->owner).'G:'.($this->group->getShortName() ?: $this->group);
foreach ([$this->dacl, $this->sacl] as $acl) {
// It should be omitted i... | php | public function toSddl($canonicalize = true)
{
// These will always be present in the SDDL...
$sddl = 'O:'.($this->owner->getShortName() ?: $this->owner).'G:'.($this->group->getShortName() ?: $this->group);
foreach ([$this->dacl, $this->sacl] as $acl) {
// It should be omitted i... | [
"public",
"function",
"toSddl",
"(",
"$",
"canonicalize",
"=",
"true",
")",
"{",
"// These will always be present in the SDDL...",
"$",
"sddl",
"=",
"'O:'",
".",
"(",
"$",
"this",
"->",
"owner",
"->",
"getShortName",
"(",
")",
"?",
":",
"$",
"this",
"->",
... | Get the SDDL string format that represents this Security Descriptor and everything it contains.
@param bool $canonicalize Whether or not to canonicalize the DACL
@return string | [
"Get",
"the",
"SDDL",
"string",
"format",
"that",
"represents",
"this",
"Security",
"Descriptor",
"and",
"everything",
"it",
"contains",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/SecurityDescriptor.php#L277-L291 |
28,055 | ldaptools/ldaptools | src/LdapTools/AttributeConverter/ConvertGroupMembership.php | ConvertGroupMembership.createOperationsFromValues | protected function createOperationsFromValues(array $values)
{
// In the case of a 'set' or 'reset' operation all current group membership should be removed.
if ($this->shouldRemoveCurrentGroups()) {
$this->removeCurrentGroups();
}
// Only if this is not a reset operation... | php | protected function createOperationsFromValues(array $values)
{
// In the case of a 'set' or 'reset' operation all current group membership should be removed.
if ($this->shouldRemoveCurrentGroups()) {
$this->removeCurrentGroups();
}
// Only if this is not a reset operation... | [
"protected",
"function",
"createOperationsFromValues",
"(",
"array",
"$",
"values",
")",
"{",
"// In the case of a 'set' or 'reset' operation all current group membership should be removed.",
"if",
"(",
"$",
"this",
"->",
"shouldRemoveCurrentGroups",
"(",
")",
")",
"{",
"$",
... | Given the set of array values create the correct operation.
@param array $values
@throws \LdapTools\Exception\AttributeConverterException | [
"Given",
"the",
"set",
"of",
"array",
"values",
"create",
"the",
"correct",
"operation",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/AttributeConverter/ConvertGroupMembership.php#L78-L91 |
28,056 | ldaptools/ldaptools | src/LdapTools/AttributeConverter/ConvertGroupMembership.php | ConvertGroupMembership.addOperation | protected function addOperation($dn, $batchType)
{
$collection = new BatchCollection($dn);
$valueDn = $this->getDn();
// The DN is unknown in the case of an add, as value/parameter resolution most occur first. If there is a better
// way to do this I'm not sure what it would be. The... | php | protected function addOperation($dn, $batchType)
{
$collection = new BatchCollection($dn);
$valueDn = $this->getDn();
// The DN is unknown in the case of an add, as value/parameter resolution most occur first. If there is a better
// way to do this I'm not sure what it would be. The... | [
"protected",
"function",
"addOperation",
"(",
"$",
"dn",
",",
"$",
"batchType",
")",
"{",
"$",
"collection",
"=",
"new",
"BatchCollection",
"(",
"$",
"dn",
")",
";",
"$",
"valueDn",
"=",
"$",
"this",
"->",
"getDn",
"(",
")",
";",
"// The DN is unknown in... | Add the correct operation for the action as a post operation to the current operation.
@param string $dn
@param int $batchType
@throws \LdapTools\Exception\AttributeConverterException | [
"Add",
"the",
"correct",
"operation",
"for",
"the",
"action",
"as",
"a",
"post",
"operation",
"to",
"the",
"current",
"operation",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/AttributeConverter/ConvertGroupMembership.php#L100-L118 |
28,057 | ldaptools/ldaptools | src/LdapTools/AttributeConverter/ConvertGroupMembership.php | ConvertGroupMembership.removeCurrentGroups | protected function removeCurrentGroups()
{
$valuesToRemove = $this->getCurrentLdapAttributeValue($this->options['from_attribute']);
$valuesToRemove = is_null($valuesToRemove) ? [] : $valuesToRemove;
$valuesToRemove = is_array($valuesToRemove) ? $valuesToRemove : [$valuesToRemove];
... | php | protected function removeCurrentGroups()
{
$valuesToRemove = $this->getCurrentLdapAttributeValue($this->options['from_attribute']);
$valuesToRemove = is_null($valuesToRemove) ? [] : $valuesToRemove;
$valuesToRemove = is_array($valuesToRemove) ? $valuesToRemove : [$valuesToRemove];
... | [
"protected",
"function",
"removeCurrentGroups",
"(",
")",
"{",
"$",
"valuesToRemove",
"=",
"$",
"this",
"->",
"getCurrentLdapAttributeValue",
"(",
"$",
"this",
"->",
"options",
"[",
"'from_attribute'",
"]",
")",
";",
"$",
"valuesToRemove",
"=",
"is_null",
"(",
... | Gets the current group membership and generates operations to remove them all.
@throws \LdapTools\Exception\AttributeConverterException | [
"Gets",
"the",
"current",
"group",
"membership",
"and",
"generates",
"operations",
"to",
"remove",
"them",
"all",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/AttributeConverter/ConvertGroupMembership.php#L134-L142 |
28,058 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.resolve | public function resolve()
{
if (!empty($this->resolvedParameters)) {
return $this->attributes;
}
$this->evaluateRequirements($this->attributes);
$this->resolveAllParameters();
return $this->attributes;
} | php | public function resolve()
{
if (!empty($this->resolvedParameters)) {
return $this->attributes;
}
$this->evaluateRequirements($this->attributes);
$this->resolveAllParameters();
return $this->attributes;
} | [
"public",
"function",
"resolve",
"(",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"resolvedParameters",
")",
")",
"{",
"return",
"$",
"this",
"->",
"attributes",
";",
"}",
"$",
"this",
"->",
"evaluateRequirements",
"(",
"$",
"this",
"->"... | Gets the attributes with all of the parameters resolved.
@return array | [
"Gets",
"the",
"attributes",
"with",
"all",
"of",
"the",
"parameters",
"resolved",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L63-L72 |
28,059 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.resolveAllParameters | protected function resolveAllParameters()
{
foreach ($this->requirements as $attribute => $parameters) {
// This parameter may have already been resolved as part of a dependency
if (!in_array($attribute, $this->resolvedParameters)) {
$this->resolveParametersForAttribu... | php | protected function resolveAllParameters()
{
foreach ($this->requirements as $attribute => $parameters) {
// This parameter may have already been resolved as part of a dependency
if (!in_array($attribute, $this->resolvedParameters)) {
$this->resolveParametersForAttribu... | [
"protected",
"function",
"resolveAllParameters",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"requirements",
"as",
"$",
"attribute",
"=>",
"$",
"parameters",
")",
"{",
"// This parameter may have already been resolved as part of a dependency",
"if",
"(",
"!",
"i... | Iterates over each requirement to resolve the parameters it contains. | [
"Iterates",
"over",
"each",
"requirement",
"to",
"resolve",
"the",
"parameters",
"it",
"contains",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L88-L96 |
28,060 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.resolveParametersForAttribute | protected function resolveParametersForAttribute($attribute, array $parameters)
{
$children = $this->getDependentAttributes($parameters);
if (!empty($children)) {
foreach ($children as $child) {
$this->resolveParametersForAttribute($child, $this->requirements[$child]);
... | php | protected function resolveParametersForAttribute($attribute, array $parameters)
{
$children = $this->getDependentAttributes($parameters);
if (!empty($children)) {
foreach ($children as $child) {
$this->resolveParametersForAttribute($child, $this->requirements[$child]);
... | [
"protected",
"function",
"resolveParametersForAttribute",
"(",
"$",
"attribute",
",",
"array",
"$",
"parameters",
")",
"{",
"$",
"children",
"=",
"$",
"this",
"->",
"getDependentAttributes",
"(",
"$",
"parameters",
")",
";",
"if",
"(",
"!",
"empty",
"(",
"$"... | Given a specific attribute with parameters, this will resolve it while first resolving any dependent attributes
that first need to be resolved.
@param $attribute
@param array $parameters | [
"Given",
"a",
"specific",
"attribute",
"with",
"parameters",
"this",
"will",
"resolve",
"it",
"while",
"first",
"resolving",
"any",
"dependent",
"attributes",
"that",
"first",
"need",
"to",
"be",
"resolved",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L105-L124 |
28,061 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.doResolveParametersForAttribute | protected function doResolveParametersForAttribute($attribute, $parameters)
{
$this->attributes[$attribute] = $this->getValueForParameters(
$parameters,
$this->attributes[$attribute],
$this->attributes
);
} | php | protected function doResolveParametersForAttribute($attribute, $parameters)
{
$this->attributes[$attribute] = $this->getValueForParameters(
$parameters,
$this->attributes[$attribute],
$this->attributes
);
} | [
"protected",
"function",
"doResolveParametersForAttribute",
"(",
"$",
"attribute",
",",
"$",
"parameters",
")",
"{",
"$",
"this",
"->",
"attributes",
"[",
"$",
"attribute",
"]",
"=",
"$",
"this",
"->",
"getValueForParameters",
"(",
"$",
"parameters",
",",
"$",... | Sets the value for an attribute with the specified parameters.
@param string $attribute
@param array $parameters | [
"Sets",
"the",
"value",
"for",
"an",
"attribute",
"with",
"the",
"specified",
"parameters",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L132-L139 |
28,062 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.getDependentAttributes | protected function getDependentAttributes($parameters)
{
$dependencies = [];
foreach ($parameters as $parameter) {
if (isset($this->requirements[$parameter]) && !in_array($parameter, $this->resolvedParameters)) {
$dependencies[] = $parameter;
}
}
... | php | protected function getDependentAttributes($parameters)
{
$dependencies = [];
foreach ($parameters as $parameter) {
if (isset($this->requirements[$parameter]) && !in_array($parameter, $this->resolvedParameters)) {
$dependencies[] = $parameter;
}
}
... | [
"protected",
"function",
"getDependentAttributes",
"(",
"$",
"parameters",
")",
"{",
"$",
"dependencies",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"parameters",
"as",
"$",
"parameter",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"requirements",
... | Checks for required parameter attributes that depend on other parameter attributes. Returns an array of
of dependencies.
@param array $parameters
@return array | [
"Checks",
"for",
"required",
"parameter",
"attributes",
"that",
"depend",
"on",
"other",
"parameter",
"attributes",
".",
"Returns",
"an",
"array",
"of",
"of",
"dependencies",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L148-L159 |
28,063 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.setRequirementsForAttribute | protected function setRequirementsForAttribute($attribute, array $value)
{
$parameters = [];
foreach ($value as $attrValue) {
$parameters = array_filter(array_merge(
$parameters,
self::getParametersInValue($attrValue)
));
}
if... | php | protected function setRequirementsForAttribute($attribute, array $value)
{
$parameters = [];
foreach ($value as $attrValue) {
$parameters = array_filter(array_merge(
$parameters,
self::getParametersInValue($attrValue)
));
}
if... | [
"protected",
"function",
"setRequirementsForAttribute",
"(",
"$",
"attribute",
",",
"array",
"$",
"value",
")",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"attrValue",
")",
"{",
"$",
"parameters",
"=",
"array_filte... | Given an attribute, set what parameters it requires.
@param string $attribute
@param array $value | [
"Given",
"an",
"attribute",
"set",
"what",
"parameters",
"it",
"requires",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L185-L199 |
28,064 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.getParametersInValue | protected static function getParametersInValue($value)
{
$parameters = [];
$regex = '/'.self::PARAM_MARKER.'(.*?)'.self::PARAM_MARKER.'/';
$value = is_array($value) ? $value : [$value];
foreach ($value as $attrValue) {
if (is_string($attrValue) && preg_match_all($regex, ... | php | protected static function getParametersInValue($value)
{
$parameters = [];
$regex = '/'.self::PARAM_MARKER.'(.*?)'.self::PARAM_MARKER.'/';
$value = is_array($value) ? $value : [$value];
foreach ($value as $attrValue) {
if (is_string($attrValue) && preg_match_all($regex, ... | [
"protected",
"static",
"function",
"getParametersInValue",
"(",
"$",
"value",
")",
"{",
"$",
"parameters",
"=",
"[",
"]",
";",
"$",
"regex",
"=",
"'/'",
".",
"self",
"::",
"PARAM_MARKER",
".",
"'(.*?)'",
".",
"self",
"::",
"PARAM_MARKER",
".",
"'/'",
";"... | Given an attribute value get all parameters it expects.
@param string|array $value
@return array | [
"Given",
"an",
"attribute",
"value",
"get",
"all",
"parameters",
"it",
"expects",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L207-L220 |
28,065 | ldaptools/ldaptools | src/LdapTools/Resolver/ParameterResolver.php | ParameterResolver.checkForCircularDependency | protected function checkForCircularDependency($parent, array $parentParameters)
{
foreach ($this->requirements as $attribute => $parameters) {
if (in_array($parent, $parameters) && in_array($attribute, $parentParameters)) {
throw new LogicException(sprintf(
'C... | php | protected function checkForCircularDependency($parent, array $parentParameters)
{
foreach ($this->requirements as $attribute => $parameters) {
if (in_array($parent, $parameters) && in_array($attribute, $parentParameters)) {
throw new LogicException(sprintf(
'C... | [
"protected",
"function",
"checkForCircularDependency",
"(",
"$",
"parent",
",",
"array",
"$",
"parentParameters",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"requirements",
"as",
"$",
"attribute",
"=>",
"$",
"parameters",
")",
"{",
"if",
"(",
"in_array",
"... | Given an attribute with parameter dependencies, check if any of them will become circular.
@param string $parent
@param array $parentParameters | [
"Given",
"an",
"attribute",
"with",
"parameter",
"dependencies",
"check",
"if",
"any",
"of",
"them",
"will",
"become",
"circular",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/ParameterResolver.php#L228-L239 |
28,066 | ldaptools/ldaptools | src/LdapTools/Query/LdapQuery.php | LdapQuery.getSingleResult | public function getSingleResult($hydratorType = HydratorFactory::TO_OBJECT)
{
$result = $this->execute($hydratorType);
$count = ($result instanceof LdapObjectCollection) ? $result->count() : count($result);
if ($count === 0) {
throw new EmptyResultException('LDAP returned no res... | php | public function getSingleResult($hydratorType = HydratorFactory::TO_OBJECT)
{
$result = $this->execute($hydratorType);
$count = ($result instanceof LdapObjectCollection) ? $result->count() : count($result);
if ($count === 0) {
throw new EmptyResultException('LDAP returned no res... | [
"public",
"function",
"getSingleResult",
"(",
"$",
"hydratorType",
"=",
"HydratorFactory",
"::",
"TO_OBJECT",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"execute",
"(",
"$",
"hydratorType",
")",
";",
"$",
"count",
"=",
"(",
"$",
"result",
"instanceof... | Retrieve a single unique result from LDAP. If the result is empty or contains more than one entry, an exception
is thrown.
@param string $hydratorType A hyrdrator type constant from the factory.
@return array|\LdapTools\Object\LdapObject
@throws EmptyResultException
@throws MultiResultException | [
"Retrieve",
"a",
"single",
"unique",
"result",
"from",
"LDAP",
".",
"If",
"the",
"result",
"is",
"empty",
"or",
"contains",
"more",
"than",
"one",
"entry",
"an",
"exception",
"is",
"thrown",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/LdapQuery.php#L162-L174 |
28,067 | ldaptools/ldaptools | src/LdapTools/Query/LdapQuery.php | LdapQuery.getSingleScalarResult | public function getSingleScalarResult()
{
if (count($this->operation->getAttributes()) !== 1 || $this->isWildCardSelection()) {
$selected = $this->isWildCardSelection() ? 'All' : count($this->operation->getAttributes());
throw new LdapQueryException(sprintf(
'When ret... | php | public function getSingleScalarResult()
{
if (count($this->operation->getAttributes()) !== 1 || $this->isWildCardSelection()) {
$selected = $this->isWildCardSelection() ? 'All' : count($this->operation->getAttributes());
throw new LdapQueryException(sprintf(
'When ret... | [
"public",
"function",
"getSingleScalarResult",
"(",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"operation",
"->",
"getAttributes",
"(",
")",
")",
"!==",
"1",
"||",
"$",
"this",
"->",
"isWildCardSelection",
"(",
")",
")",
"{",
"$",
"selected",
... | Retrieve a single selected attribute value from LDAP.
@return mixed
@throws LdapQueryException
@throws AttributeNotFoundException
@throws EmptyResultException
@throws MultiResultException | [
"Retrieve",
"a",
"single",
"selected",
"attribute",
"value",
"from",
"LDAP",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/LdapQuery.php#L185-L203 |
28,068 | ldaptools/ldaptools | src/LdapTools/Query/LdapQuery.php | LdapQuery.execute | public function execute($hydratorType = HydratorFactory::TO_OBJECT)
{
if (is_string($this->operation->getFilter()) || empty($this->operation->getFilter()->getAliases())) {
$results = $this->getResultsFromLdap(clone $this->operation, $hydratorType);
} else {
$results = $this->... | php | public function execute($hydratorType = HydratorFactory::TO_OBJECT)
{
if (is_string($this->operation->getFilter()) || empty($this->operation->getFilter()->getAliases())) {
$results = $this->getResultsFromLdap(clone $this->operation, $hydratorType);
} else {
$results = $this->... | [
"public",
"function",
"execute",
"(",
"$",
"hydratorType",
"=",
"HydratorFactory",
"::",
"TO_OBJECT",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"this",
"->",
"operation",
"->",
"getFilter",
"(",
")",
")",
"||",
"empty",
"(",
"$",
"this",
"->",
"operati... | Execute a query based on the set parameters. Optionally choose a mode to hydrate the results in.
@param string $hydratorType A hyrdrator type constant from the factory.
@return mixed|\LdapTools\Object\LdapObject|\LdapTools\Object\LdapObjectCollection | [
"Execute",
"a",
"query",
"based",
"on",
"the",
"set",
"parameters",
".",
"Optionally",
"choose",
"a",
"mode",
"to",
"hydrate",
"the",
"results",
"in",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/LdapQuery.php#L251-L260 |
28,069 | ldaptools/ldaptools | src/LdapTools/Query/LdapQuery.php | LdapQuery.setOrderBy | public function setOrderBy(array $orderBy)
{
// Validate and force the case for the direction.
foreach ($orderBy as $attribute => $direction) {
if (!in_array(strtoupper($direction), self::ORDER)) {
throw new \InvalidArgumentException(sprintf(
'Order di... | php | public function setOrderBy(array $orderBy)
{
// Validate and force the case for the direction.
foreach ($orderBy as $attribute => $direction) {
if (!in_array(strtoupper($direction), self::ORDER)) {
throw new \InvalidArgumentException(sprintf(
'Order di... | [
"public",
"function",
"setOrderBy",
"(",
"array",
"$",
"orderBy",
")",
"{",
"// Validate and force the case for the direction.",
"foreach",
"(",
"$",
"orderBy",
"as",
"$",
"attribute",
"=>",
"$",
"direction",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"strtouppe... | Set the attributes to order the results by.
@param array $orderBy In the form of ['attribute' => 'ASC', ...]
@return $this | [
"Set",
"the",
"attributes",
"to",
"order",
"the",
"results",
"by",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/LdapQuery.php#L291-L306 |
28,070 | ldaptools/ldaptools | src/LdapTools/Query/LdapQuery.php | LdapQuery.getResultsForAliases | protected function getResultsForAliases($hydratorType)
{
/** @var LdapObjectCollection|array $results */
$results = [];
foreach ($this->operation->getFilter()->getAliases() as $alias => $schema) {
$operation = clone $this->operation;
/**
* If we receive... | php | protected function getResultsForAliases($hydratorType)
{
/** @var LdapObjectCollection|array $results */
$results = [];
foreach ($this->operation->getFilter()->getAliases() as $alias => $schema) {
$operation = clone $this->operation;
/**
* If we receive... | [
"protected",
"function",
"getResultsForAliases",
"(",
"$",
"hydratorType",
")",
"{",
"/** @var LdapObjectCollection|array $results */",
"$",
"results",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"operation",
"->",
"getFilter",
"(",
")",
"->",
"getAlias... | Goes through each alias for the operation to get results only for that specific type, then combine and return
them all.
@param string $hydratorType
@return array|LdapObjectCollection|mixed | [
"Goes",
"through",
"each",
"alias",
"for",
"the",
"operation",
"to",
"get",
"results",
"only",
"for",
"that",
"specific",
"type",
"then",
"combine",
"and",
"return",
"them",
"all",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/LdapQuery.php#L393-L428 |
28,071 | ldaptools/ldaptools | src/LdapTools/Query/LdapQuery.php | LdapQuery.getSelectedForAllAliases | protected function getSelectedForAllAliases(array $aliases)
{
if (empty($aliases)) {
$selected = $this->mergeOrderByAttributes($this->getSelectedQueryAttributes($this->operation->getAttributes()));
} else {
// If there are aliases, then we need to loop through each one to det... | php | protected function getSelectedForAllAliases(array $aliases)
{
if (empty($aliases)) {
$selected = $this->mergeOrderByAttributes($this->getSelectedQueryAttributes($this->operation->getAttributes()));
} else {
// If there are aliases, then we need to loop through each one to det... | [
"protected",
"function",
"getSelectedForAllAliases",
"(",
"array",
"$",
"aliases",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"aliases",
")",
")",
"{",
"$",
"selected",
"=",
"$",
"this",
"->",
"mergeOrderByAttributes",
"(",
"$",
"this",
"->",
"getSelectedQueryA... | Get all the attributes that were selected for the query taking into account all of the aliases used.
@param array $aliases
@return array | [
"Get",
"all",
"the",
"attributes",
"that",
"were",
"selected",
"for",
"the",
"query",
"taking",
"into",
"account",
"all",
"of",
"the",
"aliases",
"used",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/LdapQuery.php#L436-L452 |
28,072 | ldaptools/ldaptools | src/LdapTools/Query/LdapQuery.php | LdapQuery.getFormattedOrderBy | protected function getFormattedOrderBy($selected, $aliases)
{
if (!empty($aliases) && !$this->isWildCardSelection()) {
$orderBy = [];
foreach ($this->orderBy as $attribute => $direction) {
list($alias, $attr) = LdapUtilities::getAliasAndAttribute($attribute);
... | php | protected function getFormattedOrderBy($selected, $aliases)
{
if (!empty($aliases) && !$this->isWildCardSelection()) {
$orderBy = [];
foreach ($this->orderBy as $attribute => $direction) {
list($alias, $attr) = LdapUtilities::getAliasAndAttribute($attribute);
... | [
"protected",
"function",
"getFormattedOrderBy",
"(",
"$",
"selected",
",",
"$",
"aliases",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"aliases",
")",
"&&",
"!",
"$",
"this",
"->",
"isWildCardSelection",
"(",
")",
")",
"{",
"$",
"orderBy",
"=",
"[",
... | This formats the orderBy array to ignore case differences between the orderBy name and the actually selected name,
such as for sorting arrays.
@param $selected
@param $aliases
@return array | [
"This",
"formats",
"the",
"orderBy",
"array",
"to",
"ignore",
"case",
"differences",
"between",
"the",
"orderBy",
"name",
"and",
"the",
"actually",
"selected",
"name",
"such",
"as",
"for",
"sorting",
"arrays",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Query/LdapQuery.php#L462-L477 |
28,073 | ldaptools/ldaptools | src/LdapTools/Factory/LdapObjectSchemaFactory.php | LdapObjectSchemaFactory.get | public function get($schemaName, $objectType)
{
$key = CacheItem::TYPE['SCHEMA_OBJECT'].'.'.$schemaName.'.'.$objectType;
if ($this->shouldBuildCacheItem($key, $schemaName)) {
$ldapObjectSchema = $this->parser->parse($schemaName, $objectType);
$this->dispatcher->dispatch(new ... | php | public function get($schemaName, $objectType)
{
$key = CacheItem::TYPE['SCHEMA_OBJECT'].'.'.$schemaName.'.'.$objectType;
if ($this->shouldBuildCacheItem($key, $schemaName)) {
$ldapObjectSchema = $this->parser->parse($schemaName, $objectType);
$this->dispatcher->dispatch(new ... | [
"public",
"function",
"get",
"(",
"$",
"schemaName",
",",
"$",
"objectType",
")",
"{",
"$",
"key",
"=",
"CacheItem",
"::",
"TYPE",
"[",
"'SCHEMA_OBJECT'",
"]",
".",
"'.'",
".",
"$",
"schemaName",
".",
"'.'",
".",
"$",
"objectType",
";",
"if",
"(",
"$... | Get the LdapObjectSchema for a specific schema name and object type.
@param string $schemaName
@param string $objectType
@return LdapObjectSchema | [
"Get",
"the",
"LdapObjectSchema",
"for",
"a",
"specific",
"schema",
"name",
"and",
"object",
"type",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Factory/LdapObjectSchemaFactory.php#L62-L75 |
28,074 | ldaptools/ldaptools | src/LdapTools/Factory/LdapObjectSchemaFactory.php | LdapObjectSchemaFactory.shouldBuildCacheItem | protected function shouldBuildCacheItem($key, $schemaName)
{
$cacheOutOfDate = false;
if ($this->cache->getUseAutoCache()) {
$lastModTime = $this->parser->getSchemaModificationTime($schemaName);
$cacheCreationTime = $this->cache->getCacheCreationTime($key);
$cache... | php | protected function shouldBuildCacheItem($key, $schemaName)
{
$cacheOutOfDate = false;
if ($this->cache->getUseAutoCache()) {
$lastModTime = $this->parser->getSchemaModificationTime($schemaName);
$cacheCreationTime = $this->cache->getCacheCreationTime($key);
$cache... | [
"protected",
"function",
"shouldBuildCacheItem",
"(",
"$",
"key",
",",
"$",
"schemaName",
")",
"{",
"$",
"cacheOutOfDate",
"=",
"false",
";",
"if",
"(",
"$",
"this",
"->",
"cache",
"->",
"getUseAutoCache",
"(",
")",
")",
"{",
"$",
"lastModTime",
"=",
"$"... | Whether or not the item needs to be parsed and cached.
@param string $key The cache key.
@param string $schemaName The schema name.
@return bool | [
"Whether",
"or",
"not",
"the",
"item",
"needs",
"to",
"be",
"parsed",
"and",
"cached",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Factory/LdapObjectSchemaFactory.php#L84-L94 |
28,075 | ldaptools/ldaptools | src/LdapTools/Connection/LdapControl.php | LdapControl.toArray | public function toArray()
{
$control = [
'oid' => $this->resolveOid(),
'iscritical' => $this->criticality
];
if (!is_null($this->value)) {
$control['value'] = $this->value;
}
return $control;
} | php | public function toArray()
{
$control = [
'oid' => $this->resolveOid(),
'iscritical' => $this->criticality
];
if (!is_null($this->value)) {
$control['value'] = $this->value;
}
return $control;
} | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"control",
"=",
"[",
"'oid'",
"=>",
"$",
"this",
"->",
"resolveOid",
"(",
")",
",",
"'iscritical'",
"=>",
"$",
"this",
"->",
"criticality",
"]",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
... | Get the control array structure that ldap_set_option expects.
@return array | [
"Get",
"the",
"control",
"array",
"structure",
"that",
"ldap_set_option",
"expects",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/LdapControl.php#L153-L164 |
28,076 | ldaptools/ldaptools | src/LdapTools/Hydrator/ArrayHydrator.php | ArrayHydrator.setAttributeFromLdap | protected function setAttributeFromLdap(array $entry, $attribute, $value)
{
if (isset($value['count']) && $value['count'] == 1) {
$entry[$attribute] = $value[0];
} elseif (isset($value['count']) && $value['count'] > 0) {
$entry[$attribute] = [];
for ($i = 0; $i < ... | php | protected function setAttributeFromLdap(array $entry, $attribute, $value)
{
if (isset($value['count']) && $value['count'] == 1) {
$entry[$attribute] = $value[0];
} elseif (isset($value['count']) && $value['count'] > 0) {
$entry[$attribute] = [];
for ($i = 0; $i < ... | [
"protected",
"function",
"setAttributeFromLdap",
"(",
"array",
"$",
"entry",
",",
"$",
"attribute",
",",
"$",
"value",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"value",
"[",
"'count'",
"]",
")",
"&&",
"$",
"value",
"[",
"'count'",
"]",
"==",
"1",
")",... | Given a specific attribute and value add it to the newly formed LDAP entry array.
@param array $entry
@param string $attribute
@param string|array $value
@return array | [
"Given",
"a",
"specific",
"attribute",
"and",
"value",
"add",
"it",
"to",
"the",
"newly",
"formed",
"LDAP",
"entry",
"array",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/ArrayHydrator.php#L204-L218 |
28,077 | ldaptools/ldaptools | src/LdapTools/Hydrator/ArrayHydrator.php | ArrayHydrator.convertValuesFromLdap | protected function convertValuesFromLdap(array $entry)
{
if (!$this->schema) {
return $entry;
}
$valueResolver = BaseValueResolver::getInstance(
$this->schema,
$entry,
$this->type
);
$this->configureValueResolver($valueResolver,... | php | protected function convertValuesFromLdap(array $entry)
{
if (!$this->schema) {
return $entry;
}
$valueResolver = BaseValueResolver::getInstance(
$this->schema,
$entry,
$this->type
);
$this->configureValueResolver($valueResolver,... | [
"protected",
"function",
"convertValuesFromLdap",
"(",
"array",
"$",
"entry",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"schema",
")",
"{",
"return",
"$",
"entry",
";",
"}",
"$",
"valueResolver",
"=",
"BaseValueResolver",
"::",
"getInstance",
"(",
"$",
... | Replace attribute values with the converted values if the attribute has a converter defined.
@param array $entry
@return array | [
"Replace",
"attribute",
"values",
"with",
"the",
"converted",
"values",
"if",
"the",
"attribute",
"has",
"a",
"converter",
"defined",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/ArrayHydrator.php#L237-L250 |
28,078 | ldaptools/ldaptools | src/LdapTools/Hydrator/ArrayHydrator.php | ArrayHydrator.mergeDefaultAttributes | protected function mergeDefaultAttributes(array $attributes)
{
if ($this->schema && !empty($this->schema->getDefaultValues())) {
$attributes = array_merge($this->schema->getDefaultValues(), $attributes);
}
return $attributes;
} | php | protected function mergeDefaultAttributes(array $attributes)
{
if ($this->schema && !empty($this->schema->getDefaultValues())) {
$attributes = array_merge($this->schema->getDefaultValues(), $attributes);
}
return $attributes;
} | [
"protected",
"function",
"mergeDefaultAttributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"schema",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"schema",
"->",
"getDefaultValues",
"(",
")",
")",
")",
"{",
"$",
"attribute... | Returns all of the attributes to be sent to LDAP after factoring in possible default schema values.
@param array $attributes
@return array | [
"Returns",
"all",
"of",
"the",
"attributes",
"to",
"be",
"sent",
"to",
"LDAP",
"after",
"factoring",
"in",
"possible",
"default",
"schema",
"values",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/ArrayHydrator.php#L258-L265 |
28,079 | ldaptools/ldaptools | src/LdapTools/Hydrator/ArrayHydrator.php | ArrayHydrator.validateAttributesToLdap | protected function validateAttributesToLdap(array $attributes)
{
if (!$this->schema) {
return;
}
$missing = [];
foreach ($this->schema->getRequiredAttributes() as $attribute) {
if (!array_key_exists(strtolower($attribute), array_change_key_case($attributes)))... | php | protected function validateAttributesToLdap(array $attributes)
{
if (!$this->schema) {
return;
}
$missing = [];
foreach ($this->schema->getRequiredAttributes() as $attribute) {
if (!array_key_exists(strtolower($attribute), array_change_key_case($attributes)))... | [
"protected",
"function",
"validateAttributesToLdap",
"(",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"schema",
")",
"{",
"return",
";",
"}",
"$",
"missing",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"schema",
... | Checks to make sure all required attributes are present.
@param array $attributes | [
"Checks",
"to",
"make",
"sure",
"all",
"required",
"attributes",
"are",
"present",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/ArrayHydrator.php#L273-L291 |
28,080 | ldaptools/ldaptools | src/LdapTools/Hydrator/ArrayHydrator.php | ArrayHydrator.convertValuesToLdap | protected function convertValuesToLdap($values, $dn = null)
{
if (!($values instanceof OperatorCollection) && !$this->schema) {
return $values;
}
$valueResolver = BaseValueResolver::getInstance(
$this->schema,
$values,
$this->type
);
... | php | protected function convertValuesToLdap($values, $dn = null)
{
if (!($values instanceof OperatorCollection) && !$this->schema) {
return $values;
}
$valueResolver = BaseValueResolver::getInstance(
$this->schema,
$values,
$this->type
);
... | [
"protected",
"function",
"convertValuesToLdap",
"(",
"$",
"values",
",",
"$",
"dn",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"values",
"instanceof",
"OperatorCollection",
")",
"&&",
"!",
"$",
"this",
"->",
"schema",
")",
"{",
"return",
"$",
"va... | Checks for attributes assigned an attribute converter. It will replace the value with the converted value then
send back all the attributes.
@param array|BatchCollection|OperatorCollection $values
@param string|null $dn
@return array|BatchCollection|OperatorCollection | [
"Checks",
"for",
"attributes",
"assigned",
"an",
"attribute",
"converter",
".",
"It",
"will",
"replace",
"the",
"value",
"with",
"the",
"converted",
"value",
"then",
"send",
"back",
"all",
"the",
"attributes",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/ArrayHydrator.php#L301-L314 |
28,081 | ldaptools/ldaptools | src/LdapTools/Hydrator/ArrayHydrator.php | ArrayHydrator.convertNamesToLdap | protected function convertNamesToLdap(array $attributes)
{
return !$this->schema ? $attributes : (new AttributeNameResolver($this->schema))->toLdap($attributes);
} | php | protected function convertNamesToLdap(array $attributes)
{
return !$this->schema ? $attributes : (new AttributeNameResolver($this->schema))->toLdap($attributes);
} | [
"protected",
"function",
"convertNamesToLdap",
"(",
"array",
"$",
"attributes",
")",
"{",
"return",
"!",
"$",
"this",
"->",
"schema",
"?",
"$",
"attributes",
":",
"(",
"new",
"AttributeNameResolver",
"(",
"$",
"this",
"->",
"schema",
")",
")",
"->",
"toLda... | Converts attribute names from their schema defined value to the value LDAP needs them in.
@param array $attributes
@return array | [
"Converts",
"attribute",
"names",
"from",
"their",
"schema",
"defined",
"value",
"to",
"the",
"value",
"LDAP",
"needs",
"them",
"in",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/ArrayHydrator.php#L322-L325 |
28,082 | ldaptools/ldaptools | src/LdapTools/Hydrator/ArrayHydrator.php | ArrayHydrator.configureValueResolver | protected function configureValueResolver(BaseValueResolver $valueResolver, $dn = null)
{
if ($this->connection) {
$valueResolver->setLdapConnection($this->connection);
}
if (!is_null($dn)) {
$valueResolver->setDn($dn);
}
} | php | protected function configureValueResolver(BaseValueResolver $valueResolver, $dn = null)
{
if ($this->connection) {
$valueResolver->setLdapConnection($this->connection);
}
if (!is_null($dn)) {
$valueResolver->setDn($dn);
}
} | [
"protected",
"function",
"configureValueResolver",
"(",
"BaseValueResolver",
"$",
"valueResolver",
",",
"$",
"dn",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"connection",
")",
"{",
"$",
"valueResolver",
"->",
"setLdapConnection",
"(",
"$",
"this",
... | Retrieve the AttributeValueResolver instance with the connection and other information set if needed.
@param BaseValueResolver $valueResolver
@param null|string $dn | [
"Retrieve",
"the",
"AttributeValueResolver",
"instance",
"with",
"the",
"connection",
"and",
"other",
"information",
"set",
"if",
"needed",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/ArrayHydrator.php#L344-L352 |
28,083 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeValueResolver.php | AttributeValueResolver.fromLdap | public function fromLdap()
{
$entry = $this->convert($this->entry, false);
foreach ($entry as $attribute => $value) {
if ($this->schema->isMultivaluedAttribute($attribute) && !is_array($value)) {
$entry[$attribute] = [$value];
}
}
return $ent... | php | public function fromLdap()
{
$entry = $this->convert($this->entry, false);
foreach ($entry as $attribute => $value) {
if ($this->schema->isMultivaluedAttribute($attribute) && !is_array($value)) {
$entry[$attribute] = [$value];
}
}
return $ent... | [
"public",
"function",
"fromLdap",
"(",
")",
"{",
"$",
"entry",
"=",
"$",
"this",
"->",
"convert",
"(",
"$",
"this",
"->",
"entry",
",",
"false",
")",
";",
"foreach",
"(",
"$",
"entry",
"as",
"$",
"attribute",
"=>",
"$",
"value",
")",
"{",
"if",
"... | Convert values from LDAP.
@return array | [
"Convert",
"values",
"from",
"LDAP",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeValueResolver.php#L50-L61 |
28,084 | ldaptools/ldaptools | src/LdapTools/Resolver/AttributeValueResolver.php | AttributeValueResolver.convert | protected function convert(array $attributes, $toLdap = true)
{
$direction = $toLdap ? 'toLdap' : 'fromLdap';
foreach ($attributes as $attribute => $values) {
// No converter, but the value should still be encoded.
if (!$this->schema->hasConverter($attribute) && !isset($this... | php | protected function convert(array $attributes, $toLdap = true)
{
$direction = $toLdap ? 'toLdap' : 'fromLdap';
foreach ($attributes as $attribute => $values) {
// No converter, but the value should still be encoded.
if (!$this->schema->hasConverter($attribute) && !isset($this... | [
"protected",
"function",
"convert",
"(",
"array",
"$",
"attributes",
",",
"$",
"toLdap",
"=",
"true",
")",
"{",
"$",
"direction",
"=",
"$",
"toLdap",
"?",
"'toLdap'",
":",
"'fromLdap'",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"attribute",
"=>"... | Perform the attribute conversion process.
@param array $attributes
@param bool $toLdap
@return array | [
"Perform",
"the",
"attribute",
"conversion",
"process",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Resolver/AttributeValueResolver.php#L80-L99 |
28,085 | ldaptools/ldaptools | src/LdapTools/Hydrator/HydrateQueryTrait.php | HydrateQueryTrait.mergeOrderByAttributes | protected function mergeOrderByAttributes(array $attributes, $alias = null)
{
if (!$this->isWildCardSelection() && !empty($this->orderBy)) {
$orderBy = $this->getAttributesForAlias(array_keys($this->orderBy), $alias);
$lcAttributes = array_map('strtolower', $attributes);
... | php | protected function mergeOrderByAttributes(array $attributes, $alias = null)
{
if (!$this->isWildCardSelection() && !empty($this->orderBy)) {
$orderBy = $this->getAttributesForAlias(array_keys($this->orderBy), $alias);
$lcAttributes = array_map('strtolower', $attributes);
... | [
"protected",
"function",
"mergeOrderByAttributes",
"(",
"array",
"$",
"attributes",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isWildCardSelection",
"(",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"orderBy",
")",
... | If any attributes that were requested to be ordered by are not explicitly in the attribute selection, add them.
@param array $attributes
@param null|string $alias
@return array | [
"If",
"any",
"attributes",
"that",
"were",
"requested",
"to",
"be",
"ordered",
"by",
"are",
"not",
"explicitly",
"in",
"the",
"attribute",
"selection",
"add",
"them",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/HydrateQueryTrait.php#L32-L45 |
28,086 | ldaptools/ldaptools | src/LdapTools/Hydrator/HydrateQueryTrait.php | HydrateQueryTrait.getSelectedQueryAttributes | protected function getSelectedQueryAttributes(array $attributes, LdapObjectSchema $schema = null)
{
// Interpret a single wildcard as only schema attributes.
if ($schema && !empty($attributes) && $attributes[0] == '*') {
$attributes = array_keys($schema->getAttributeMap());
// In... | php | protected function getSelectedQueryAttributes(array $attributes, LdapObjectSchema $schema = null)
{
// Interpret a single wildcard as only schema attributes.
if ($schema && !empty($attributes) && $attributes[0] == '*') {
$attributes = array_keys($schema->getAttributeMap());
// In... | [
"protected",
"function",
"getSelectedQueryAttributes",
"(",
"array",
"$",
"attributes",
",",
"LdapObjectSchema",
"$",
"schema",
"=",
"null",
")",
"{",
"// Interpret a single wildcard as only schema attributes.",
"if",
"(",
"$",
"schema",
"&&",
"!",
"empty",
"(",
"$",
... | Determine what attributes should be selected. This helps account for all attributes being selected both within
and out of the context of a schema.
@param array $attributes
@param LdapObjectSchema|null $schema
@return array | [
"Determine",
"what",
"attributes",
"should",
"be",
"selected",
".",
"This",
"helps",
"account",
"for",
"all",
"attributes",
"being",
"selected",
"both",
"within",
"and",
"out",
"of",
"the",
"context",
"of",
"a",
"schema",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/HydrateQueryTrait.php#L55-L66 |
28,087 | ldaptools/ldaptools | src/LdapTools/Hydrator/HydrateQueryTrait.php | HydrateQueryTrait.getAttributesToLdap | protected function getAttributesToLdap(array $attributes, $translate, LdapObjectSchema $schema = null, $alias = null)
{
// First determine if this was some sort of wildcard selection
$attributes = $this->getSelectedQueryAttributes($attributes, $schema);
// This will return only the attribute... | php | protected function getAttributesToLdap(array $attributes, $translate, LdapObjectSchema $schema = null, $alias = null)
{
// First determine if this was some sort of wildcard selection
$attributes = $this->getSelectedQueryAttributes($attributes, $schema);
// This will return only the attribute... | [
"protected",
"function",
"getAttributesToLdap",
"(",
"array",
"$",
"attributes",
",",
"$",
"translate",
",",
"LdapObjectSchema",
"$",
"schema",
"=",
"null",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"// First determine if this was some sort of wildcard selection",
"$"... | Performs the logic needed to determine what attributes were actually selected, or should be selected, when going
to LDAP and whether they should be returned as schema translated names.
@param array $attributes
@param bool
@param LdapObjectSchema|null $schema
@param null|string $alias
@return array | [
"Performs",
"the",
"logic",
"needed",
"to",
"determine",
"what",
"attributes",
"were",
"actually",
"selected",
"or",
"should",
"be",
"selected",
"when",
"going",
"to",
"LDAP",
"and",
"whether",
"they",
"should",
"be",
"returned",
"as",
"schema",
"translated",
... | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Hydrator/HydrateQueryTrait.php#L98-L124 |
28,088 | ldaptools/ldaptools | src/LdapTools/Utilities/DialInData.php | DialInData.toBinary | public function toBinary()
{
$binary = hex2bin(str_pad(dechex(ord($this->signature)), 2, 0, STR_PAD_LEFT));
$binary .= hex2bin($this->dec2hex($this->userPrivilege));
$binary .= hex2bin($this->callbackPhoneNumber);
return $binary;
} | php | public function toBinary()
{
$binary = hex2bin(str_pad(dechex(ord($this->signature)), 2, 0, STR_PAD_LEFT));
$binary .= hex2bin($this->dec2hex($this->userPrivilege));
$binary .= hex2bin($this->callbackPhoneNumber);
return $binary;
} | [
"public",
"function",
"toBinary",
"(",
")",
"{",
"$",
"binary",
"=",
"hex2bin",
"(",
"str_pad",
"(",
"dechex",
"(",
"ord",
"(",
"$",
"this",
"->",
"signature",
")",
")",
",",
"2",
",",
"0",
",",
"STR_PAD_LEFT",
")",
")",
";",
"$",
"binary",
".=",
... | Get the binary representation of the dial-in data for the userParameters value.
@return string | [
"Get",
"the",
"binary",
"representation",
"of",
"the",
"dial",
"-",
"in",
"data",
"for",
"the",
"userParameters",
"value",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Utilities/DialInData.php#L123-L130 |
28,089 | ldaptools/ldaptools | src/LdapTools/Connection/BindUserStrategy.php | BindUserStrategy.getInstance | public static function getInstance(DomainConfiguration $config)
{
if (LdapConnection::TYPE_AD == $config->getLdapType()) {
return new ADBindUserStrategy($config);
} else {
return new self($config);
}
} | php | public static function getInstance(DomainConfiguration $config)
{
if (LdapConnection::TYPE_AD == $config->getLdapType()) {
return new ADBindUserStrategy($config);
} else {
return new self($config);
}
} | [
"public",
"static",
"function",
"getInstance",
"(",
"DomainConfiguration",
"$",
"config",
")",
"{",
"if",
"(",
"LdapConnection",
"::",
"TYPE_AD",
"==",
"$",
"config",
"->",
"getLdapType",
"(",
")",
")",
"{",
"return",
"new",
"ADBindUserStrategy",
"(",
"$",
"... | Given the LDAP type, determine the BindStrategy to use.
@param DomainConfiguration $config
@return ADBindUserStrategy|BindUserStrategy | [
"Given",
"the",
"LDAP",
"type",
"determine",
"the",
"BindStrategy",
"to",
"use",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/BindUserStrategy.php#L59-L66 |
28,090 | ldaptools/ldaptools | src/LdapTools/Connection/BindUserStrategy.php | BindUserStrategy.getUsername | public function getUsername($username)
{
if ($this->isValidUserDn($username)) {
return $username;
}
$replacements = [
$username,
$this->config->getDomainName(),
];
return preg_replace($this->params, $replacements, $this->bindFormat);
} | php | public function getUsername($username)
{
if ($this->isValidUserDn($username)) {
return $username;
}
$replacements = [
$username,
$this->config->getDomainName(),
];
return preg_replace($this->params, $replacements, $this->bindFormat);
} | [
"public",
"function",
"getUsername",
"(",
"$",
"username",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isValidUserDn",
"(",
"$",
"username",
")",
")",
"{",
"return",
"$",
"username",
";",
"}",
"$",
"replacements",
"=",
"[",
"$",
"username",
",",
"$",
"t... | Determine the format to use for a bind username going to LDAP.
@param string $username
@return string | [
"Determine",
"the",
"format",
"to",
"use",
"for",
"a",
"bind",
"username",
"going",
"to",
"LDAP",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Connection/BindUserStrategy.php#L74-L85 |
28,091 | ldaptools/ldaptools | src/LdapTools/Ldif/Ldif.php | Ldif.addEntry | public function addEntry(LdifEntryInterface ...$entries)
{
foreach ($entries as $entry) {
$this->entries[] = $entry;
}
return $this;
} | php | public function addEntry(LdifEntryInterface ...$entries)
{
foreach ($entries as $entry) {
$this->entries[] = $entry;
}
return $this;
} | [
"public",
"function",
"addEntry",
"(",
"LdifEntryInterface",
"...",
"$",
"entries",
")",
"{",
"foreach",
"(",
"$",
"entries",
"as",
"$",
"entry",
")",
"{",
"$",
"this",
"->",
"entries",
"[",
"]",
"=",
"$",
"entry",
";",
"}",
"return",
"$",
"this",
";... | Add one or more LDIF entry objects.
@param LdifEntryInterface[] ...$entries
@return $this | [
"Add",
"one",
"or",
"more",
"LDIF",
"entry",
"objects",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Ldif.php#L160-L167 |
28,092 | ldaptools/ldaptools | src/LdapTools/Ldif/Ldif.php | Ldif.toString | public function toString()
{
$ldif = $this->addCommentsToString('');
if (!is_null($this->version)) {
$ldif .= $this->getLdifLine(self::DIRECTIVE_VERSION, $this->version);
}
foreach ($this->entries as $entry) {
$this->setupEntry($entry);
$ldif .= $t... | php | public function toString()
{
$ldif = $this->addCommentsToString('');
if (!is_null($this->version)) {
$ldif .= $this->getLdifLine(self::DIRECTIVE_VERSION, $this->version);
}
foreach ($this->entries as $entry) {
$this->setupEntry($entry);
$ldif .= $t... | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"ldif",
"=",
"$",
"this",
"->",
"addCommentsToString",
"(",
"''",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"version",
")",
")",
"{",
"$",
"ldif",
".=",
"$",
"this",
"->",
"... | Get the string representation of the LDIF object with all of the entries it has.
@return string | [
"Get",
"the",
"string",
"representation",
"of",
"the",
"LDIF",
"object",
"with",
"all",
"of",
"the",
"entries",
"it",
"has",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Ldif.php#L184-L196 |
28,093 | ldaptools/ldaptools | src/LdapTools/Ldif/Ldif.php | Ldif.toOperations | public function toOperations()
{
$operations = [];
foreach ($this->entries as $entry) {
$this->setupEntry($entry);
$operations[] = $entry->toOperation();
}
return $operations;
} | php | public function toOperations()
{
$operations = [];
foreach ($this->entries as $entry) {
$this->setupEntry($entry);
$operations[] = $entry->toOperation();
}
return $operations;
} | [
"public",
"function",
"toOperations",
"(",
")",
"{",
"$",
"operations",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"entries",
"as",
"$",
"entry",
")",
"{",
"$",
"this",
"->",
"setupEntry",
"(",
"$",
"entry",
")",
";",
"$",
"operations",
... | Get all of the operations represented by all of the entries for this LDIF object.
@return LdapOperationInterface[] | [
"Get",
"all",
"of",
"the",
"operations",
"represented",
"by",
"all",
"of",
"the",
"entries",
"for",
"this",
"LDIF",
"object",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Ldif/Ldif.php#L203-L213 |
28,094 | ldaptools/ldaptools | src/LdapTools/Security/Flags.php | Flags.remove | public function remove(...$flags)
{
foreach ($flags as $flag) {
if ($this->has($flag)) {
$this->flags = $this->flags ^ (int) $flag;
}
}
return $this;
} | php | public function remove(...$flags)
{
foreach ($flags as $flag) {
if ($this->has($flag)) {
$this->flags = $this->flags ^ (int) $flag;
}
}
return $this;
} | [
"public",
"function",
"remove",
"(",
"...",
"$",
"flags",
")",
"{",
"foreach",
"(",
"$",
"flags",
"as",
"$",
"flag",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"has",
"(",
"$",
"flag",
")",
")",
"{",
"$",
"this",
"->",
"flags",
"=",
"$",
"this",
... | Remove a flag from the value.
@param int[] ...$flags
@return $this | [
"Remove",
"a",
"flag",
"from",
"the",
"value",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/Security/Flags.php#L56-L65 |
28,095 | ldaptools/ldaptools | src/LdapTools/LdapManager.php | LdapManager.addConnection | public function addConnection(LdapConnectionInterface ...$connections)
{
foreach ($connections as $connection) {
$this->domains[$connection->getConfig()->getDomainName()] = $connection->getConfig();
$this->connections[$connection->getConfig()->getDomainName()] = $connection;
... | php | public function addConnection(LdapConnectionInterface ...$connections)
{
foreach ($connections as $connection) {
$this->domains[$connection->getConfig()->getDomainName()] = $connection->getConfig();
$this->connections[$connection->getConfig()->getDomainName()] = $connection;
... | [
"public",
"function",
"addConnection",
"(",
"LdapConnectionInterface",
"...",
"$",
"connections",
")",
"{",
"foreach",
"(",
"$",
"connections",
"as",
"$",
"connection",
")",
"{",
"$",
"this",
"->",
"domains",
"[",
"$",
"connection",
"->",
"getConfig",
"(",
"... | Explicitly add connections using already constructed connection objects.
@param Connection\LdapConnectionInterface[] $connections
@return $this | [
"Explicitly",
"add",
"connections",
"using",
"already",
"constructed",
"connection",
"objects",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/LdapManager.php#L144-L152 |
28,096 | ldaptools/ldaptools | src/LdapTools/LdapManager.php | LdapManager.getConnection | public function getConnection($domain = null)
{
$domain = $domain ?: $this->context;
$this->validateDomainName($domain);
if (!$this->connections[$domain]) {
$this->connections[$domain] = new LdapConnection(
$this->domains[$domain],
$this->config->... | php | public function getConnection($domain = null)
{
$domain = $domain ?: $this->context;
$this->validateDomainName($domain);
if (!$this->connections[$domain]) {
$this->connections[$domain] = new LdapConnection(
$this->domains[$domain],
$this->config->... | [
"public",
"function",
"getConnection",
"(",
"$",
"domain",
"=",
"null",
")",
"{",
"$",
"domain",
"=",
"$",
"domain",
"?",
":",
"$",
"this",
"->",
"context",
";",
"$",
"this",
"->",
"validateDomainName",
"(",
"$",
"domain",
")",
";",
"if",
"(",
"!",
... | Get the Ldap Connection object. By default it will get the connection of the domain currently in context. To get
a different domain connection pass the domain name as a parameter.
@param null|string $domain
@return Connection\LdapConnectionInterface | [
"Get",
"the",
"Ldap",
"Connection",
"object",
".",
"By",
"default",
"it",
"will",
"get",
"the",
"connection",
"of",
"the",
"domain",
"currently",
"in",
"context",
".",
"To",
"get",
"a",
"different",
"domain",
"connection",
"pass",
"the",
"domain",
"name",
... | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/LdapManager.php#L161-L176 |
28,097 | ldaptools/ldaptools | src/LdapTools/LdapManager.php | LdapManager.createLdapObject | public function createLdapObject($type = null)
{
$creator = new LdapObjectCreator(
$this->getConnection(),
$this->getSchemaFactory(),
$this->config->getEventDispatcher()
);
if ($type) {
$creator->create($type);
}
return $creato... | php | public function createLdapObject($type = null)
{
$creator = new LdapObjectCreator(
$this->getConnection(),
$this->getSchemaFactory(),
$this->config->getEventDispatcher()
);
if ($type) {
$creator->create($type);
}
return $creato... | [
"public",
"function",
"createLdapObject",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"$",
"creator",
"=",
"new",
"LdapObjectCreator",
"(",
"$",
"this",
"->",
"getConnection",
"(",
")",
",",
"$",
"this",
"->",
"getSchemaFactory",
"(",
")",
",",
"$",
"this",... | Get a LdapObjectCreator object.
@param string|null $type
@return LdapObjectCreator | [
"Get",
"a",
"LdapObjectCreator",
"object",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/LdapManager.php#L194-L206 |
28,098 | ldaptools/ldaptools | src/LdapTools/LdapManager.php | LdapManager.getRepository | public function getRepository($type)
{
try {
$ldapObjectSchema = $this->getLdapObjectSchema($type);
$repositoryClass = $ldapObjectSchema->getRepository();
if (!class_exists($repositoryClass)) {
throw new \RuntimeException(sprintf('Repository class "%s" not... | php | public function getRepository($type)
{
try {
$ldapObjectSchema = $this->getLdapObjectSchema($type);
$repositoryClass = $ldapObjectSchema->getRepository();
if (!class_exists($repositoryClass)) {
throw new \RuntimeException(sprintf('Repository class "%s" not... | [
"public",
"function",
"getRepository",
"(",
"$",
"type",
")",
"{",
"try",
"{",
"$",
"ldapObjectSchema",
"=",
"$",
"this",
"->",
"getLdapObjectSchema",
"(",
"$",
"type",
")",
";",
"$",
"repositoryClass",
"=",
"$",
"ldapObjectSchema",
"->",
"getRepository",
"(... | Get a repository for a specific LDAP object type.
@param string $type
@return LdapObjectRepository | [
"Get",
"a",
"repository",
"for",
"a",
"specific",
"LDAP",
"object",
"type",
"."
] | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/LdapManager.php#L224-L243 |
28,099 | ldaptools/ldaptools | src/LdapTools/LdapManager.php | LdapManager.delete | public function delete(LdapObject $ldapObject, $recursively = false)
{
$this->getObjectManager()->delete($ldapObject, $recursively);
return $this;
} | php | public function delete(LdapObject $ldapObject, $recursively = false)
{
$this->getObjectManager()->delete($ldapObject, $recursively);
return $this;
} | [
"public",
"function",
"delete",
"(",
"LdapObject",
"$",
"ldapObject",
",",
"$",
"recursively",
"=",
"false",
")",
"{",
"$",
"this",
"->",
"getObjectManager",
"(",
")",
"->",
"delete",
"(",
"$",
"ldapObject",
",",
"$",
"recursively",
")",
";",
"return",
"... | Delete an object from LDAP. Optionally you can set the second argument to true which sends a control to LDAP to
perform a recursive deletion. This is helpful in the case of deleting an OU with with objects underneath it. By
setting the second parameter to true the OU and all objects below it would be deleted. Use with ... | [
"Delete",
"an",
"object",
"from",
"LDAP",
".",
"Optionally",
"you",
"can",
"set",
"the",
"second",
"argument",
"to",
"true",
"which",
"sends",
"a",
"control",
"to",
"LDAP",
"to",
"perform",
"a",
"recursive",
"deletion",
".",
"This",
"is",
"helpful",
"in",
... | b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7 | https://github.com/ldaptools/ldaptools/blob/b7a4f6df96ef83e82c7ed6238e4d0346c0f666f7/src/LdapTools/LdapManager.php#L269-L274 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.