ExamGecko
Home Home / Adobe / AD0-E717

Adobe AD0-E717 Practice Test - Questions Answers, Page 4

Question list
Search
Search

List of questions

Search

How should a record be removed from a database which is using a model that was inherited from the \Magento\Framework\Model\AbstractModel class?

A.
Call the 'unset' method on this model object
A.
Call the 'unset' method on this model object
Answers
B.
Call the 'remove' method on this model object
B.
Call the 'remove' method on this model object
Answers
C.
Call the 'delete' method on this model object
C.
Call the 'delete' method on this model object
Answers
Suggested answer: C

Explanation:

The 'delete' method on the \Magento\Framework\Model\AbstractModel class is used to remove a record from the database. This method will also cascade the delete to any related records.

In a new release of a module, a developer decides to rename a table that was defined in the earlier versions. Which action, if any, allows the developer to prevent data loss?

A.
Define onCreate='migrateDataFromAnotherTable(old_table_name)' attribute in the table tag.
A.
Define onCreate='migrateDataFromAnotherTable(old_table_name)' attribute in the table tag.
Answers
B.
Declarative schema supports RENAME TABLE', so the data will be migrated to the new table automatically.
B.
Declarative schema supports RENAME TABLE', so the data will be migrated to the new table automatically.
Answers
C.
Define the table and columns mapping in the db.schema_whitelist.json
C.
Define the table and columns mapping in the db.schema_whitelist.json
Answers
Suggested answer: A

Explanation:

To prevent data loss when renaming a table that was defined in the earlier versions of a module, the developer should define onCreate=''migrateDataFromAnotherTable(old_table_name)'' attribute in the table tag of the db_schema.xml file. This attribute will instruct Adobe Commerce to copy all data from the old table to the new table during installation or upgrade.

Declarative schema does not support RENAME TABLE statement, so the data will not be migrated to the new table automatically. The db.schema_whitelist.json file is used to whitelist changes that are allowed for backward compatibility, not for data migration.

Verified

Reference:Adobe Commerce Developer Guide - Declare schema and data patches

A developer defined a new table in db.schema.xml while creating a new module.

What should be done to allow the removal of columns from the database when deleting them from db.schema.xml?

A.
The removable columns should be defined in db_schema_whitelist.json.
A.
The removable columns should be defined in db_schema_whitelist.json.
Answers
B.
The columns should have 'removable' attribute set to 'true' in the db.schema.xml.
B.
The columns should have 'removable' attribute set to 'true' in the db.schema.xml.
Answers
C.
The removable columns should be defined in db.schema_blacklist.json.
C.
The removable columns should be defined in db.schema_blacklist.json.
Answers
Suggested answer: A

Explanation:

If a developer wants to allow the removal of columns from the database when deleting them from db.schema.xml, they need to define the removable columns in the db_schema_whitelist.json file. This file will tell Magento which columns can be removed from the database.

Which attribute option restricts Catalog EAV attributes to only certain product types?

A.
show.in
A.
show.in
Answers
B.
apply_to
B.
apply_to
Answers
C.
allowed_in
C.
allowed_in
Answers
Suggested answer: C

Explanation:

The allowed_in attribute restricts Catalog EAV attributes to only certain product types. This attribute can be used to prevent certain attributes from being displayed on certain product types.

Which two methods add sorting to collections inherited from the \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection class? (Choose two.)

A.
setOrder
A.
setOrder
Answers
B.
setSorting
B.
setSorting
Answers
C.
addSorting
C.
addSorting
Answers
D.
addOrder
D.
addOrder
Answers
Suggested answer: A, D

Explanation:

The two methods that add sorting to collections inherited from the \Magento\Framework\Model\ResourceModel\Db\Collection\AbstractCollection class are setOrder and addOrder. These methods allow adding one or more order clauses to a collection query.

The setSorting and addSorting methods do not exist in Adobe Commerce.

Verified

Reference: [Adobe Commerce Developer Guide - Collections]

The value of a product attribute in the Adobe Commerce system needs to have a different format before it is displayed. Which attribute model class is responsible for this?

A.
Frontend
A.
Frontend
Answers
B.
Backend
B.
Backend
Answers
C.
Source
C.
Source
Answers
Suggested answer: A

Explanation:

The frontend attribute model class is responsible for formatting the value of a product attribute before it is displayed on the storefront. This class can implement methods such as getValue, getLabel, getInputType, and getOptionText to modify the attribute value.

The backend attribute model class is responsible for saving and loading the attribute value to and from the database. The source attribute model class is responsible for providing the list of options for an attribute.

Verified

Reference: [Adobe Commerce Developer Guide - Attribute models]

A developer would like to initialize a theme in Adobe Commerce. Which two files are required to complete this task? (Choose two.)

A.
theme.less
A.
theme.less
Answers
B.
registration.php
B.
registration.php
Answers
C.
composerjson
C.
composerjson
Answers
D.
themexml
D.
themexml
Answers
Suggested answer: B, D

Explanation:

The two files that are required to initialize a theme in Adobe Commerce are registration.php and theme.xml. The registration.php file registers the theme in the system and assigns a unique name to it. The theme.xml file declares the theme's title, parent theme, media directory, and preview image.

The theme.less file is not required to initialize a theme, but it can be used to define global styles for the theme. The composer.json file is not required to initialize a theme, but it can be used to manage dependencies and packages for the theme.

Verified

Reference: [Adobe Commerce Developer Guide - Create a theme]

A developer needs to initialize the jQuery Ul widget for a specific HTML tag. Which HTML attribute is used for this?

A.
x-magento-init
A.
x-magento-init
Answers
B.
data-mage-init
B.
data-mage-init
Answers
C.
data-ui
C.
data-ui
Answers
Suggested answer: B

Explanation:

The data-mage-init HTML attribute is used to initialize the jQuery UI widget for a specific HTML tag. This attribute specifies the name of the widget and its configuration options as a JSON object.

The x-magento-init HTML attribute is used to initialize RequireJS modules for a specific HTML tag. The data-ui HTML attribute does not exist in Adobe Commerce.

Verified

Reference: [Adobe Commerce Developer Guide - Initialize JavaScript components using the data-mage-init attribute]

How can a custom CMS Page be set as a store home page?

A.
In the CMS Page admin grid, select the checkbox for the page under the 'Home Page' column.
A.
In the CMS Page admin grid, select the checkbox for the page under the 'Home Page' column.
Answers
B.
In the CMS Page admin form, set the 'Default Home Page' value to 'yes'
B.
In the CMS Page admin form, set the 'Default Home Page' value to 'yes'
Answers
C.
In the store configuration, set a custom CMS Page to be a CMS home page
C.
In the store configuration, set a custom CMS Page to be a CMS home page
Answers
Suggested answer: C

Explanation:

To set a custom CMS Page as a store home page, the developer or merchant should follow these steps:

In the Admin panel, go to Content > Pages and create or edit a CMS Page that will be used as a home page.

In the Admin panel, go to Stores > Configuration > General > Web > Default Pages.

In the CMS Home Page field, select the CMS Page that was created or edited in step 1.

Save the configuration.

There is no ''Home Page'' column in the CMS Page admin grid or ''Default Home Page'' value in the CMS Page admin form.

Verified

Reference: [Adobe Commerce User Guide - Set up your home page]

Which theme directory contains the static files that can be loaded directly?

A.
web
A.
web
Answers
B.
preprocessed
B.
preprocessed
Answers
C.
assets
C.
assets
Answers
Suggested answer: A

Explanation:

The web directory contains the static files that can be loaded directly. This directory includes files such as CSS, JavaScript, and images.

Total 77 questions
Go to page: of 8