@param string                                $field Field name
@param array                                 $attr  Base HTML attributes
@param \Darvin\AdminBundle\Metadata\Metadata $meta  Metadata

@return array
327333
private function buildBodyRowItemAttr($field, array $attr, Metadata $meta)
    {
        $class = 'name_'.$field;

        $mappings = $meta->getMappings();

        if (isset($mappings[$field]) && !isset($mappings[$field]['targetEntity'])) {
            $class .= ' type_'.$mappings[$field]['type'];
        }

        $attr['class'] = trim(isset($attr['class']) ? $attr['class'].' '.$class : $class);

        return $attr;
    }
49089
private static function _parse_form_attributes($attributes, $default)
    {
        if (is_array($attributes)) {
            foreach ($default as $key => $val) {
                if (isset($attributes[$key])) {
                    $default[$key] = $attributes[$key];
                    unset($attributes[$key]);
                }
            }

            if (count($attributes) > 0) {
                $default = array_merge($default, $attributes);
            }
        }

        $att = '';

        foreach ($default as $key => $val) {
            if ($key == 'value') {
                $val = self::form_prep($val, $default['name']);
            }

            $att .= $key . '="' . $val . '" ';
        }

        return $att;
    }
459859
public function getFieldsFromMetadata(ClassMetadata $metadata)
    {
        /* @var \Doctrine\ORM\Mapping\ClassMetadataInfo|\Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo $metadata */
        $fields = (array) $metadata->getFieldNames();

        $exclude = array(
            'createdAt', 'created_at', 'createdBy', 'created_by',
            'updatedAt', 'updated_at', 'updatedBy', 'updated_by',
        );

        // Remove the primary key field if it's not managed manually
        $fields = array_diff($fields, $metadata->getIdentifier());

        foreach ($metadata->associationMappings as $fieldName => $relation) {
            if ($relation['type'] !== 4) {
                $fields[] = $fieldName;
            }
        }

        return array_values(array_diff($fields, $exclude));
    }
946542
def field(name, *params)
      @model.translated_attribute_names.push name.to_sym
      @model.translated_attr_accessor(name)
      @model.translation_class.field name, *params
    end
345253
public function attributes($field)
    {
        $parts = explode('.', $field);
        $table = $this->_getTable($parts);
        $column = (array)$table->getSchema()->getColumn(array_pop($parts));
        $whitelist = ['length' => null, 'precision' => null];

        return array_intersect_key($column, $whitelist);
    }
870322
def parse_meta(content, meta_name, source_descr, content_attr_name="content"):
    
    dom = dhtmlparser.parseString(content)

    meta_tags = dom.find(
        "meta",
        fn=lambda x: x.params.get("name", "").lower() == meta_name.lower()
    )

    return [
        SourceString(tag.params[content_attr_name], source_descr)
        for tag in meta_tags
        if content_attr_name in tag.params
    ]
1071851
protected function getCategoryIdFromMetadata(array $attr)
    {

        // load the metadata of the passed URL rewrite entity
        $metadata = $this->getMetadata($attr);

        // return the category ID from the metadata
        return (integer) $metadata[UrlRewriteObserver::CATEGORY_ID];
    }
1302274
public function onHtmlField($field)
    {
        $pieces = preg_split("/[\[\]]+/", $field, 0, PREG_SPLIT_NO_EMPTY);
        $errors = $this;
        foreach(array_slice($pieces, 0, -1) as $key) {
            $errors = $errors->forKey(Util::delimiterToCamelCase($key));
            if (!isset($errors)) { return []; }
        }
        $finalKey = Util::delimiterToCamelCase(end($pieces));
        return $errors->onAttribute($finalKey);
    }
479935
private function getTagAttribute(StructureMetadata $metadata, $tag, $attribute, $default)
    {
        if (!$metadata->hasTag($tag)) {
            return $default;
        }

        $tag = $metadata->getTag($tag);
        if (!array_key_exists($attribute, $tag['attributes'])) {
            return $default;
        }

        return $tag['attributes'][$attribute];
    }
1229593
private function getFieldsFromMetadata(ClassMetadataInfo $metadata)
    {
        $fields = (array) $metadata->getFieldNames();

        // Remove the primary key field if it's not managed manually
        if ($metadata->isIdGeneratorAuto()) {
            $fields = array_diff($fields, array($metadata->identifier));
        }

        return $fields;
    }
1232785
function attribute( $attr )
    {
        switch ( $attr )
        {
            case "original_filename":
                return $this->OriginalFilename;
            case "mime_type":
                return $this->Type;
            case "mime_type_category":
                return $this->MimeCategory;
            case "mime_type_part":
                return $this->MimePart;
            case "filename":
                return $this->Filename;
            case "filesize":
                return $this->Size;
            case "is_temporary":
                return $this->IsTemporary;
            default:
            {
                eZDebug::writeError( "Attribute '$attr' does not exist", __METHOD__ );
                return null;
            } break;
        }
    }
363393
def list_meta_fields():
    '''
    
    '''
    ret = {}
    status, result = _query(action='meta', command='fields')
    root = ET.fromstring(result)
    fields = root.getchildren()
    for field in fields:
        field_id = None
        field_ret = {'name': field.text}
        for item in field.items():
            field_ret[item[0]] = item[1]
            if item[0] == 'id':
                field_id = item[1]
        ret[field_id] = field_ret
    return ret
267176
public function displayMetaValue($atts, $content = "")
    {
        //Default value
        extract(shortcode_atts(array(
            'key' => ''
        ), $atts));

        //Get field with formatting if exits
        if (function_exists('get_field')) {
            return (string) get_field($key);
        } else {
            global $post;
            return (string) get_post_meta($post->ID, $key);
        }
    }
687940
protected function __getMetaString()
    {
        $strOutput = "";

        foreach ($this->__meta as $key => $value) {
            if (! in_array($key, array_merge($this->__reservedmeta, $this->__fieldmeta))) {
                $strOutput .= " {$key}=\"{$value}\"";
            }
        }

        return $strOutput;
    }
937086
private function getFieldName(ClassMetadata $metadata, $field)
    {
        /* @var \Doctrine\ORM\Mapping\ClassMetadata $metadata */
        return $metadata->getFieldName($field) ?: $metadata->getFieldForColumn($field);
    }
748848
protected function markup(array $field)
    {
        $attributes = $field['attributes'];
        $attributes = $this->addAttribute($attributes, 'id', $field['id']);
        $attributes = $this->addAttribute($attributes, 'name', $field['name']);
        $output = '';
        $output .= $this->getWrapper('markup', $attributes);
        $output .= $field['value'];
        $output .= $this->getWrapperEnd('markup');
        return $output;
    }
1131118
static function input_attr(&$attr)
	{
	    $str = " ";
        if(!empty($attr) && is_array($attr))
        {
            foreach($attr as $key=>$value)
            {
                $str .= "$key=\"$value\" ";
            }
        }
        return $str;
	}