See to which ObjectClasses an attribute is assigned

The objectclasses are sorted into the keys 'may' and 'must'.

@param string $attribute Name or OID of the attribute

@return array|Net_LDAP2_Error Associative array with OCL names or Error
501542
public function getAssignedOCLs($attribute)
    {
        $may  = array();
        $must = array();

        // Test if the attribute type is defined in the schema,
        // if so, retrieve real name for lookups
        $attr_entry = $this->get('attribute', $attribute);
        if ($attr_entry instanceof Net_LDAP2_ERROR) {
            return PEAR::raiseError("Attribute $attribute not defined in schema: ".$attr_entry->getMessage());
        } else {
            $attribute = $attr_entry['name'];
        }


        // We need to get all defined OCLs for this.
        $ocls = $this->getAll('objectclasses');
        foreach ($ocls as $ocl => $ocl_data) {
            // Fetch the may and must attrs and see if our searched attr is contained.
            // If so, record it in the corresponding array.
            $ocl_may_attrs  = $this->may($ocl);
            $ocl_must_attrs = $this->must($ocl);
            if (is_array($ocl_may_attrs) && in_array($attribute, $ocl_may_attrs)) {
                array_push($may, $ocl_data['name']);
            }
            if (is_array($ocl_must_attrs) && in_array($attribute, $ocl_must_attrs)) {
                array_push($must, $ocl_data['name']);
            }
        }

        return array('may' => $may, 'must' => $must);
    }
324616
public function getTableAttribute($attribute)
    {
        if (! array_key_exists($attribute, $this->tableAttributes)) {
            throw new \Exception("Table attribute '{$attribute}' does not exist.");
        }

        return $this->tableAttributes[$attribute];
    }
454535
protected function checkAttribute($attribute)
    {
        if (!(isset($this->container[$attribute]) || array_key_exists($attribute, $this->container))) {
            throw new ModelException(
                sprintf(
                    "No such attribute '%s'. Available attributes are {%s}",
                    $attribute,
                    join(", ", array_keys($this->fields()))
                )
            );
        }

        return $this;
    }
583763
protected function getDynamicEncrypted($attribute)
    {
        // Dynamically get the encrypted attributes
        if ($this->isEncryptable($attribute)) {
            // Decrypt only encrypted values
            if ($this->isEncrypted($attribute)) {
                return $this->getEncryptedAttribute($attribute);
            }
        }
    }
637370
final public function hasAttribute (string $attribute) : bool
	{
		$objectAttributes = $this->attributes();
		return array_key_exists($attribute, $objectAttributes);
	}
218636
public function first($attribute=null) {
		if($attribute !== null)
			return $this->attribute($attribute)->first();
		else {
			if($this->rules)
				return array_values($this->rules)[0];
			elseif($this->attributes)
				return array_values($this->attributes)[0]->error();
		}
	}
1096863
public function guessColumnForQuery( $attribute )
	{
		if ( in_array( $attribute, array_collapse( $this->implicitAttributes ) ) && !is_numeric( $last = last( explode( '.', $attribute ) ) ) )
		{
			return $last;
		}

		return $attribute;
	}
240895
protected function extractDataFromPath( $attribute )
	{
		$results = [];

		$value = Arr::get( $this->data, $attribute, '__missing__' );

		if ( $value != '__missing__' )
		{
			Arr::set( $results, $attribute, $value );
		}

		return $results;
	}
791823
protected function getAttributeType($attribute)
    {
        $value = $this->data[$attribute];
        if (is_numeric($value)) {
            return 'numeric';
        } elseif (is_array($value)) {
            return 'array';
        } elseif ($value instanceof \SplFileObject) {
            return 'file';
        }

        return 'string';
    }
868822
protected function getRule($attribute, $rules)
	{
		if ( ! array_key_exists($attribute, $this->rules))
		{
			return;
		}

		$rules = (array) $rules;

		foreach ($this->rules[$attribute] as $rule)
		{
			list($rule, $parameters) = $this->parseRule($rule);

			if (in_array($rule, $rules)) return [$rule, $parameters];
		}
	}
248301
public function getAttributeToLdap($attribute)
    {
        return $this->hasAttribute($attribute) ? $this->lcAttributeNameMap[strtolower($attribute)] : $attribute;
    }
802661
public function getAttribute($attribute) {
		if (isset($this->_attributes[$attribute])) {
			return $this->_attributes[$attribute];
		}

		return null;
	}
1281936
public function getEncryptedAttribute($attribute)
    {
        $value = array_get($this->attributes, $attribute);

        return $this->isEncrypted($attribute) ? $this->decrypt($value) : $value;
    }
153351
protected function getAttribute( $attribute )
	{
		$primaryAttribute = $this->getPrimaryAttribute( $attribute );

		$expectedAttributes = $attribute != $primaryAttribute ? [$attribute, $primaryAttribute] : [$attribute];

		foreach ( $expectedAttributes as $expectedAttributeName )
		{
			// The developer may dynamically specify the array of custom attributes
			// on this Validator instance. If the attribute exists in this array
			// it takes precedence over all other ways we can pull attributes.
			if ( isset( $this->customAttributes[$expectedAttributeName] ) )
			{
				return $this->customAttributes[$expectedAttributeName];
			}

			$key = "validation.attributes.{$expectedAttributeName}";

			// We allow for the developer to specify language lines for each of the
			// attributes allowing for more displayable counterparts of each of
			// the attributes. This provides the ability for simple formats.
			if ( ( $line = $this->translator->trans( $key ) ) !== $key )
			{
				return $line;
			}
		}

		// When no language line has been specified for the attribute and it is
		// also an implicit attribute we will display the raw attribute name
		// and not modify it with any replacements before we display this.
		if ( isset( $this->implicitAttributes[$primaryAttribute] ) )
		{
			return $attribute;
		}

		return str_replace( '_', ' ', Str::snake( $attribute ) );
	}
768092
public function isFirstErrorAttribute($attribute) {
		if($this->_firstErrorAttribute === false) {
			$errorAttributes = array_keys($this->firstErrors);
			$this->_firstErrorAttribute = array_shift($errorAttributes);
		}

		return $attribute == $this->_firstErrorAttribute;
	}
582038
public function getAttribute($attribute)
    {
        if ($attribute == PDO::ATTR_DRIVER_NAME) {
            return "oci8";
        }

        if (isset($this->options[$attribute])) {
            return $this->options[$attribute];
        }

        return null;
    }
48022
protected function selectAttributes($attributes = ['*'])
    {
        $attributes = $attributes ?: ['*'];

        if ($attributes == ['*'] && $this->attributes != ['*']) {
            $attributes = $this->attributes;
        }

        return $attributes;
    }