Certificated magento

Q.4.12) Which methods are generally available in setup scripts to manipulate database tables and indexes?

Q.4.12) Which methods are generally available in setup scripts to manipulate  database tables and indexes?

newTable, addForeignKey, addColumn, addIndex,... More information : http://goweb.vn/kien-thuc-web-vi/thiet-ke-web/411identify-how-to-use-the-ddl-class-in-setup-scripts--854.html

Read more

Q.4.13) What is the difference between addAttribute() and updateAttribute() in EAV setup scripts?

Q.4.13) What is the difference between addAttribute() and  updateAttribute() in EAV setup scripts?

   /**      * Adding attribute to entity      *      * @param   Mage_Eav_Model_Entity_Attribute_Abstract $attribute      * @return  Mage_Eav_Model_Entity_Abstract      */     public function addAttribute(Mage_Eav_Model_Entity_Attribute_Abstract...

Read more

Q.4.14) How can you implement a rollback in Magento?

Q.4.14) How can you implement a rollback in Magento?

 \Mage_Core_Model_Resource_Abstract::beginTransaction $this->beginTransaction();   \Mage_Core_Model_Resource_Abstract::commit $this->commit();   \Mage_Core_Model_Resource_Abstract::rollBack $this->rollback();

Read more

4.12) Define basic EAV concepts and class hierarchy

4.12) Define basic EAV concepts and class hierarchy

Working with EAV Model in Magento seems to be a quite complicated issue but you can totally make it easier with our new series of tutorials. This part will start with some main concepts of EAV   I-Definition of EAV According to Wikipedia: Entity-Attribute-Value model (EAV), also known as object-attribute-value model...

Read more

4.13) Describe the database schema for EAV entities

4.13) Describe the database schema for EAV entities

 The EAV data storage in Magento seems quite complicated with the separated data for each store. There are some data storage tables: •EAV entity type: stores the entity type including the information of model for the entity or the default attribute set     •EAV entity: Contains an eav_entity...

Read more

4.14) Describe the EAV entity structure and its difference from the standard core resource model

4.14) Describe the EAV entity structure and its difference from the standard core resource  model

  The EAV data storage in Magento seems quite complicated with the separated data for each store. There are some data storage tables: •EAV entity type: stores the entity type including the information of model for the entity or the default attribute set     •EAV entity: Contains an eav_entity...

Read more

4.15)Describe the EAV load-and-save process and its differences from the regular load- and-save process

4.15)Describe the EAV load-and-save process and its differences from the regular load- and-save process

We will explore our journey through Magento’s EAV Model further by showing how we can easily load and save an EAV entity. First, let’s discover the EAV entity’s structure and then I’ll show you the way to load and save entities in details. I-Structure of an eav entity •An entity...

Read more

Q.4.14) Which classes in Mage_Eav are used as resource models and which are used as regular models?

Q.4.14) Which classes in Mage_Eav are used as resource models and which are  used as regular models?

Resource Models for instance: - Mage_Eav_Model_Entity_Abstract - Mage_Eav_Model_Entity_Collection_Abstract Normal models for instance: - Mage_Core_Model_Resource_Collection_Abstract

Read more

Q4.16) Which entities in a native Magento installation use EAV resource models and why?

Q4.16) Which entities in a native Magento installation use EAV resource models and why?

Entities: - customer - customer address - products - product categories - orders - invoices - credit memos - shipments Why: - easy attribute additions and subtractions - database grows vertically not horizontally   sales_setup   /**  * Install eav entity types to the eav/entity_type table  */ $installer->addEntityType('order',...

Read more

Q4.17) What are the advantages and disadvantages of EAV over flat table resource models?

Q4.17) What are the advantages and disadvantages of EAV over flat table  resource models?

 - flexibility vs. less benefit for performance and more complexity

Read more

Q4.18)How are store and website scope attribute values implemented in the Magneto EAV system?

Q4.18)How are store and website scope attribute values implemented in the  Magneto EAV system?

- The each entity attribute type table has a column for the store_id for example the catalog_product_entity_int - NO IDEA: store view

Read more

Q4.19) How does the model distinguish between insert and update operations?

Q4.19) How does the model distinguish between insert and update operations?

- magento checks if the attribute exists and if the original value and the new value differ

Read more

Q4.20)How do load and save processes for EAV entities differ from those for flat table entities? What parts are identical?

Q4.20)How do load and save processes for EAV entities differ from those for  flat table entities? What parts are identical?

- when the attribute data is populated the EAV resources saves the data to table like a flat resource does - flat table save/update operations can be performed by the entity_id - eav entitiy....

Read more

4.16)Identify the purpose of attribute frontend, source, and backend models

4.16)Identify the purpose of attribute frontend, source, and backend models

1) EAV Attribute Property backend_model The role of attribute backend model is to process attribute data according to its type whenever the parent entity object is loaded, saved, or deleted. A reference to a backend model class can be set in a database in the table eav_attributes or assigned dynamically when attribute...

Read more

Q4.22) Which methods have to be implemented in a custom source model (or frontend model or backend model)?

Q4.22) Which methods have to be implemented in a custom source model (or  frontend model or backend model)?

BACKEND: public function getTable(); public function isStatic(); public function getType(); public function getEntityIdField(); public function setValueId($valueId); public function getValueId(); public function afterLoad($object); public function beforeSave($object); public function afterSave($object); public...

Read more

Q4.24) What is the default frontend model (and source and backend model) for EAV attributes?

Q4.24) What is the default frontend model (and source and backend model) for  EAV attributes?

- sub classes of the their abstract classes - they add no further methods

Read more

Q4.25) Does every attribute use a source model?

Q4.25) Does every attribute use a source model?

 - no, a source model is only needed if data needs to be populated in the frontend, for example for select inputs

Read more

Q4.26)Which classes and methods are related to updating the EAV attribute values in the flat catalog tables? What factors allow for attributes to be added to flat catalog tables?

Q4.26)Which classes and methods are related to updating the EAV attribute  values in the flat catalog tables? What factors allow for attributes to be  added to flat catalog tables?

- attributes need to be static? - Mage_Eav_Model_Entity_Attribute_Backend_Abstract::getTable() gets the right table - and name of the entity type id http://www.pixafy.com/blog/2013/08/optimizing-magento-series-part-1-flat-tables-download-free-module/

Read more

Q4.27) How are store-scoped entity attribute values stored when catalog flat storage is enabled for that entity type?

Q4.27) How are store-scoped entity attribute values stored when catalog flat  storage is enabled for that entity type?

- in db table eav_entity_type the is the table name relation for each entity type stored

Read more

Q4.30)How do you get a list of all options for an attribute for a specified store view in addition to the admin scope?

Q4.30)How do you get a list of all options for an attribute for a specified store  view in addition to the admin scope?

The following code snippet should work perfectly on your installation:   $attribute = Mage::getSingleton('eav/config')->getAttribute('catalog_product', 'color'); if ($attribute->usesSource()) {     $options = $attribute->getSource()->getAllOptions(false); } By the way Mage_Eav_Model_Config...

Read more

4.18) Describe how to create and customize attributes.

4.18) Describe how to create and customize attributes.

An EAV attribute in Magento can be managed easily in the backend. But when you need to create/update an attribute for your module, you can use some function provided by Magento. Magento provides the class Mage_Eav_Model_Entity_Setup for you to customize an EAV attribute. -If you want to add a new attribute,...

Read more

Q.4.31) Which setup methods are available to work with EAV entities?

Q.4.31) Which setup methods are available to work with EAV entities?

 - addAttribute - addAttributeGroup - addAttributeOption - addAttributeSet - addAttributeToGroup - addAttributeToSet - addEntityType - updateAttribute - updateAttributeCode - updateAttributeSet - updateEntityType

Read more

Q4.33)What is the difference between addAttribute() and updateAttribute()?

Q4.33)What is the difference between addAttribute() and  updateAttribute()?

- updateAttribute needs the attribute id - insertAttribute also checks if the attribute already exists - if so, it performs an update instead an insert

Read more

Q.6.1)What is the difference between admin and frontend controllers?

Q.6.1)What is the difference between admin and frontend controllers?

- admin controllers check first if a user is logged in

Read more

Q.6.2) When does Magento figure out which area to use on the current page?

Q.6.2) When does Magento figure out which area to use on the current page?

- if the standard router can't find a module he checks if the user is in the admin area Mage::app()->getStore()->isAdmin() - if so he he sets the module to 'admin' - Mage_Adminhtml_Controller_Action sets the right area in the preDispatch method

Read more

Q.6.3)How you can make your controller work under the /admin route?

Q.6.3)How you can make your controller work under the /admin route?

- needs to extend from Mage_Adminhtml_Controller_Action - the route needs to be added in the admin section of the module configuration

Read more

Q6.4)At which moment does Magento check if a user is logged in or not?

Q6.4)At which moment does Magento check if a user is logged in or not?

 On event controller_action_predispatch a admin/helper method checks if the user is logged in - Mage_Adminhtml_Controller_Action::preDispatch()

Read more

Q6.5)What are the roles of adminhtml config?

Q6.5)What are the roles of adminhtml config?

- Init modules configuration and add tabs and menus - creating sections and adding configuration labels - admin menu, acl, layout

Read more

Q6.6) What are the differences between the different cache types on the admin cache cleaning page?

Q6.6) What are the differences between the different cache types on the  admin cache cleaning page?

 Available modes are : * Zend_Cache::CLEANING_MODE_ALL (default) => remove all cache entries ($tags is not used) * Zend_Cache::CLEANING_MODE_OLD => remove too old cache entries ($tags is not used) * Zend_Cache::CLEANING_MODE_MATCHING_TAG => remove cache entries matching all given tags * ($tags can be an...

Read more

Q6.7)What is the difference between “Flush storage” and “Flush Magento Cache”?

Q6.7)What is the difference between “Flush storage” and “Flush Magento  Cache”?

- flush storage calls Zend_Cache_Core::clean() with no tags in mode 'all' so everything is gonna flushed - flush magento cache flushes every cache with the mage tag

Read more

Q6.10) Describe the role of a form container and its template.

Q6.10) Describe the role of a form container and its template.

 - used for wrapping - one more container for 'real' form - Set Fieldset to Form -Set form object -Add new element type

Read more

Q6.11) Describe the concept of Form elements, and list system elements implemented in Magento.

Q6.11) Describe the concept of Form elements, and list system elements  implemented in Magento.

awlink, buttons, checkbox, date, editor, fieldset, file, gallery, hidden, imagefile, image, label, link, multiline, multiselect, note, obscure, password, radio, reset, select, submit, textarea, text, time

Read more

Q6.12)Describe the concept of Fieldsets

Q6.12)Describe the concept of Fieldsets

- a fieldset is an html form element - a fieldset contains one ore more fields - the fieldset form class will orde the fields before generating the output

Read more

Q6.13) How can you render an element with a custom template?

Q6.13) How can you render an element with a custom template?

 - call the setTemplate() method of the element

Read more

6.2) Create a simple form and grid for a custom entity

6.2) Create a simple form and grid for a custom entity

https://markshust.com/2012/07/05/creating-magento-adminhtml-grids-simplified

Read more