Get an individual Distinguished Name property for a certificate/crl issuer

@param string $propName
@param bool $withType optional
@access public
@return mixed
435489
function getIssuerDNProp($propName, $withType = false)
    {
        switch (true) {
            case !isset($this->currentCert) || !is_array($this->currentCert):
                break;
            case isset($this->currentCert['tbsCertificate']):
                return $this->getDNProp($propName, $this->currentCert['tbsCertificate']['issuer'], $withType);
            case isset($this->currentCert['tbsCertList']):
                return $this->getDNProp($propName, $this->currentCert['tbsCertList']['issuer'], $withType);
        }

        return false;
    }
965622
protected function createColumn($columnName, $withForms = false)
    {
        $column = new $this->columnClass($columnName, array(
            /* used for more verbose error messages */
            'builder' => $this->getYamlKey(),
            'generator' => $this->getBaseGeneratorName(),
        ));

        //Set the user parameters
        $this->setUserColumnConfiguration($column);

        $column->setDbType($this->getFieldOption(
            $column,
            'dbType',
            $this->getFieldGuesser()->getDbType(
                $this->getVariable('model'),
                $columnName
            )
        ));

        $column->setManyToMany($this->getFieldGuesser()->getManyToMany($this->getVariable('model'), $columnName));

        $column->setSortType($this->getFieldGuesser()->getSortType($column->getDbType()));

        $column->setPrimaryKey($this->getFieldOption(
            $column,
            'primaryKey',
            $this->getFieldGuesser()->getPrimaryKeyFor(
                $this->getVariable('model'),
                $columnName
            )
        ));

        if ($withForms) {
            $column->setFormType($this->getFieldOption(
                $column,
                'formType',
                $this->getFieldGuesser()->getFormType(
                    $column->getDbType(),
                    $this->getVariable('model'),
                    $columnName
                )
            ));

            // We don't use $column->getDbType because filtered column
            // might be on a field from an association. So we need to
            // resolve the filtered field dbType (and not the column
            // one).
            $filteredFieldDbType = $this->getFieldGuesser()->getDbType(
                $this->getVariable('model'),
                $column->getFilterOn()
            );

            $column->setFilterType($this->getFieldOption(
                $column,
                'filterType',
                $this->getFieldGuesser()->getFilterType(
                    $filteredFieldDbType,
                    $this->getVariable('model'),
                    $column->getFilterOn()
                )
            ));

            if ($this->getYamlKey() === 'list') {
                // Filters
                $column->setFilterOptions($this->getFieldOption(
                    $column,
                    'filterOptions',
                    $this->getFieldOption(
                        $column,
                        'formOptions',
                        $this->getFieldGuesser()->getFilterOptions(
                            $column->getFilterType(),
                            $filteredFieldDbType,
                            $this->getVariable('model'),
                            $column->getFilterOn()
                        )
                    )
                ));
            } else {
                $column->setFormOptions($this->getFieldOption(
                    $column,
                    'formOptions',
                    $this->getFieldGuesser()->getFormOptions(
                        $column->getFormType(),
                        $column->getDbType(),
                        $this->getVariable('model'),
                        $columnName
                    )
                ));
            }

            $fields = $this->getVariable('fields', array());
            $fieldOptions = is_array($fields) && array_key_exists($column->getName(), $fields)
                ? $fields[$column->getName()]
                : array();

            if (array_key_exists('addFormOptions', $fieldOptions)) {
                $column->setAddFormOptions($fieldOptions['addFormOptions']);
            }

            if (array_key_exists('addFilterOptions', $fieldOptions)) {
                $column->setAddFilterOptions($fieldOptions['addFilterOptions']);
            } elseif (array_key_exists('addFormOptions', $fieldOptions)) {
                $column->setAddFilterOptions($fieldOptions['addFormOptions']);
            }
        }

        return $column;
    }
391655
public function withCertificates(Certificate ...$cert): self
    {
        $obj = clone $this;
        $obj->_certs = array_merge($obj->_certs, $cert);
        return $obj;
    }
496444
public Object get(String propName) {
        if (propName.equals(PROP_IDENTIFIER)) {
            return getIdentifier();
        }
        if (propName.equals(PROP_VIEW_IDENTIFIERS)) {
            return getViewIdentifiers();
        }
        if (propName.equals(PROP_PARENT)) {
            return getParent();
        }
        if (propName.equals(PROP_CHILDREN)) {
            return getChildren();
        }
        if (propName.equals(PROP_GROUPS)) {
            return getGroups();
        }
        if (propName.equals(PROP_CREATE_TIMESTAMP)) {
            return getCreateTimestamp();
        }
        if (propName.equals(PROP_MODIFY_TIMESTAMP)) {
            return getModifyTimestamp();
        }
        if (propName.equals(PROP_ENTITLEMENT_INFO)) {
            return getEntitlementInfo();
        }
        if (propName.equals(PROP_CHANGE_TYPE)) {
            return getChangeType();
        }
        return null;
    }
1132342
private function compileWith($with)
    {
        static $mapping = [
            'rule'     => self::WITH_RULE,
            'media'    => self::WITH_MEDIA,
            'supports' => self::WITH_SUPPORTS,
            'all'      => self::WITH_ALL,
        ];

        // exclude selectors by default
        $without = static::WITH_RULE;

        if ($this->libMapHasKey([$with, static::$with])) {
            $without = static::WITH_ALL;

            $list = $this->coerceList($this->libMapGet([$with, static::$with]));

            foreach ($list[2] as $item) {
                $keyword = $this->compileStringContent($this->coerceString($item));

                if (array_key_exists($keyword, $mapping)) {
                    $without &= ~($mapping[$keyword]);
                }
            }
        }

        if ($this->libMapHasKey([$with, static::$without])) {
            $without = 0;

            $list = $this->coerceList($this->libMapGet([$with, static::$without]));

            foreach ($list[2] as $item) {
                $keyword = $this->compileStringContent($this->coerceString($item));

                if (array_key_exists($keyword, $mapping)) {
                    $without |= $mapping[$keyword];
                }
            }
        }

        return $without;
    }
415738
public function property($name, $type = null, $db_location = null, $with_form = 0, $restrictions = array(), $form_components = array()) {

    if (is_a($name, 'XClassProperty')) {
      $this->properties[$name->name()] = $name;
    } else {
      if (is_array($name)) {
        $current_property = new XClassProperty($name);
        $this->properties[$current_property->name()] = $current_property;
      } else {

        $current_property = new XClassProperty(
                                                array(
                                                  'name'  =>  $name,
                                                  'type'  =>  $type,
                                                  'defaultValue'  =>  null,
                                                  'value'   =>  null,
                                                  'db_location' => $db_location
                                                )
                                              );

        $this->properties[$name] = $current_property;

      }
    }
	}
1158019
function getDNProp($propName, $dn = NULL, $withType = false)
    {
        if (!isset($dn)) {
            $dn = $this->dn;
        }

        if (empty($dn)) {
            return false;
        }

        if (($propName = $this->_translateDNProp($propName)) === false) {
            return false;
        }

        $dn = $dn['rdnSequence'];
        $result = array();
        $asn1 = new File_ASN1();
        for ($i = 0; $i < count($dn); $i++) {
            if ($dn[$i][0]['type'] == $propName) {
                $v = $dn[$i][0]['value'];
                if (!$withType && is_array($v)) {
                    foreach ($v as $type => $s) {
                        $type = array_search($type, $asn1->ANYmap, true);
                        if ($type !== false && isset($asn1->stringTypeSize[$type])) {
                            $s = $asn1->convert($s, $type);
                            if ($s !== false) {
                                $v = $s;
                                break;
                            }
                        }
                    }
                    if (is_array($v)) {
                        $v = array_pop($v); // Always strip data type.
                    }
                }
                $result[] = $v;
            }
        }

        return $result;
    }
966811
public static String extractMavenPropertyName(String propName) {
        Matcher matcher = Pattern.compile(MAVEN_PROPERTY_REGEXP).matcher(propName);
        if (matcher.matches()) {
            return matcher.group(1);
        } else {
            return null;
        }
    }
980007
public static String getGetterName(String propertyName, Class type) {
        String prefix = type == boolean.class || type == Boolean.class ? "is" : "get";
        return prefix + MetaClassHelper.capitalize(propertyName);
    }
1273330
function isScalar ($propName)
  {
    $type = $this->getTypeOf ($propName);
    return $type == type::bool || $type == type::id || $type == type::number ||
           $type == type::string;
  }
1134597
public function getName($type)
    {
        $ref = new \ReflectionClass($this);
        foreach ($ref->getConstants() as $name => $value) {
            if ($value === $type) {
                return $name;
            }
        }

        throw new \InvalidArgumentException(sprintf('There is no token with value %s.', json_encode($type)));
    }
1052582
public function getKey($withPrefix = false)
    {
        $key = ($withPrefix) ? $this->prefix : '';
        $key .= $this->key;

        return $key;
    }
163815
public function getNode($id, $withParent = false) {
        $repo = $this->getRepository();
        $pk = $repo->getPrimaryKey();
        $query = $repo->select();

        if ($withParent) {
            $query
                ->where($repo->getAlias() . '.' . $pk, $id)
                ->leftJoin(
                    [$repo->getTable(), 'Parent'],
                    array_keys($repo->getSchema()->getColumns()), // We need the fields or joins fail
                    [$this->getConfig('parentField') => 'Parent.' . $pk]
                );
        } else {
            $query->where($pk, $id);
        }

        return $query->first();
    }
111730
public function schemaToFqClassName(SchemaDescriptor $schema, $withMajor = false)
    {
        $id = $schema->getId();
        $vendor = StringUtils::toCamelFromSlug($id->getVendor());
        $package = StringUtils::toCamelFromSlug(str_replace('.', '-', $id->getPackage()));
        return "{$vendor}{$package}{$this->schemaToClassName($schema, $withMajor)}";
    }
665079
public function get_display_name($item, $withpostfix = true) {
        return format_text($item->name, FORMAT_HTML, array('noclean' => true, 'para' => false)) .
                ($withpostfix ? $this->get_display_name_postfix($item) : '');
    }
597692
function getDNProp($propName, $dn = null, $withType = false)
    {
        if (!isset($dn)) {
            $dn = $this->dn;
        }

        if (empty($dn)) {
            return false;
        }

        if (($propName = $this->_translateDNProp($propName)) === false) {
            return false;
        }

        $asn1 = new ASN1();
        $asn1->loadOIDs($this->oids);
        $filters = array();
        $filters['value'] = array('type' => ASN1::TYPE_UTF8_STRING);
        $asn1->loadFilters($filters);
        $this->_mapOutDNs($dn, 'rdnSequence', $asn1);
        $dn = $dn['rdnSequence'];
        $result = array();
        for ($i = 0; $i < count($dn); $i++) {
            if ($dn[$i][0]['type'] == $propName) {
                $v = $dn[$i][0]['value'];
                if (!$withType) {
                    if (is_array($v)) {
                        foreach ($v as $type => $s) {
                            $type = array_search($type, $asn1->ANYmap, true);
                            if ($type !== false && isset($asn1->stringTypeSize[$type])) {
                                $s = $asn1->convert($s, $type);
                                if ($s !== false) {
                                    $v = $s;
                                    break;
                                }
                            }
                        }
                        if (is_array($v)) {
                            $v = array_pop($v); // Always strip data type.
                        }
                    } elseif (is_object($v) && $v instanceof Element) {
                        $map = $this->_getMapping($propName);
                        if (!is_bool($map)) {
                            $decoded = $asn1->decodeBER($v);
                            $v = $asn1->asn1map($decoded[0], $map);
                        }
                    }
                }
                $result[] = $v;
            }
        }

        return $result;
    }
1046237
public function getProperty($prop)
    {
        if (!isset($this->properties[$prop])) {
            return null;
        }

        return $this->properties[$prop];
    }