1
votes

Couldn't find any information in google on this post.

I know that this field (frontend_input) is a part of some attribute class.

Where I could find it in the code and how does it work?

UPDATE: I found a class folder where frontend_input classes are defined.

It is a lib/Varien/Data/Form/Element/.**

Some logic I found here - app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php:

    /**
     * Retrieve attribute codes by front-end type
     *
     * @param string $frontendType
     * @return array
     */
    public function getAttributeCodesByFrontendType($frontendType)
    {
        $adapter = $this->_getReadAdapter();
        $bind    = array(':frontend_input' => $frontendType);
        $select  = $adapter->select()
            ->from($this->getTable('eav/attribute'), 'attribute_code')
            ->where('frontend_input = :frontend_input');

        return $adapter->fetchCol($select, $bind);
    }

and getAttributeCodesByFrontendType call here:

app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php

$eavResource = Mage::getResourceModel('catalog/eav_attribute');

$multiSelectAttributeCodes = $eavResource->getAttributeCodesByFrontendType('multiselect');

But I don't still understand enough what does *frontend_input* field use for?

2

2 Answers

1
votes

There is a definition in xml that tells the system what EAV you will use, and what Type (Integer, Decimal, Varachar, Date, etc) of data it will store.

The EAV tables, each one representing the defined Data type, will store the Entity Id of the Product, as well as the Attribute ID and the value.

Have a look at this link:

http://www.magento-exchange.com/wp-content/uploads/2010/11/Magento-EAV-ER-Diagram.png

I will also attach it in the post.ERD for EAV relationships

1
votes

So, it seems I found an answer. The value of this field to set type of frontend field type. If you set select you will get selectbox in admin panel. Text type - input box. So each type stores its values in [entyty_name]entity[type]. For example: catalog_category_entity_varchar.