AD0-E716問題集でリアル試験問題でテストエンジン問題集でトレーニング [Q28-Q50]

Share

AD0-E716問題集でリアル試験問題でテストエンジン問題集でトレーニング

Adobe AD0-E716テスト問題集とオンライン試験エンジン


Adobe AD0-E716 認定試験の出題範囲:

トピック出題範囲
トピック 1
  • Git パッチの使用例と Composer でのファイル レベルの変更について説明します
トピック 2
  • Adobe Commerce でルートがどのように機能するかについての知識を実証する
  • パッチと定期的なセットアップを使用してデータベースを変更する方法を説明する
トピック 3
  • EAV 属性と属性セットをプログラムで操作する
  • Adobe Commerce でキャッシュを効果的に使用する方法をデモンストレーションする
トピック 4
  • カスタム拡張属性の構築、使用、操作
  • 依存関係注入の機能と制約について説明する
トピック 5
  • Adobe Commerce からデータをインポート
  • エクスポートする機能をデモンストレーションする
  • CRON スケジューリング システムがどのように機能するかを説明する
トピック 6
  • キューイング システムの使用能力を実証する
  • CLI を使用したクラウド変数の更新についての理解を実証する
トピック 7
  • さまざまな種類のログにアクセスする方法を特定する
  • CLI を使用した分岐についての理解を実証する
トピック 8
  • データベース スキーマを拡張する機能を実証する
  • ストア設定でフィールドを追加および構成する方法を説明する
トピック 9
  • 配送方法を追加およびカスタマイズする能力を実証する
  • クラウド プロジェクト ファイル、権限、および構造に関する実践的な知識を実証する
トピック 10
  • グリッドとフォームを更新および作成する機能をデモンストレーションする
  • Adobe Commerce の設定レイヤーを使用する機能をデモンストレーションする
トピック 11
  • Adobe Commerce アーキテクチャ
  • 環境ワークフローに関する知識を実証する
  • クラウド ユーザー管理とオンボーディング UI についての理解を実証する

 

質問 # 28
What is the command used to upgrade ECE-Tools on an Adobe Commerce Cloud platform?

  • A. magento-cloud ece-tools:upgrade
  • B. composer update magento/ece-tools --with-all-dependencies
  • C. php ./vendor/bin/ece-tools upgrade

正解:B

解説:
The command used to upgrade ECE-Tools on an Adobe Commerce Cloud platform is composer update magento/ece-tools --with-all-dependencies. This command will update the ECE-Tools package and its dependencies to the latest version available in the composer repository. The developer then needs to commit and push the changes to the composer.json and composer.lock files and redeploy the environment. Verified Reference: [Magento 2.4 DevDocs]


質問 # 29
An Adobe Commerce developer is being tasked with creating a new cron job to run a method that has already been written. What are the minimally required steps to accomplish this?

  • A. Create a crontab.xmi file and a new system configuration in system.xmi for the schedule.
  • B. Create crontab.xmi and cron_groups.xmi files to assign the new job to a cron group.
  • C. Create a crontab.xmi file and set a schedule for the new cron job.

正解:C

解説:
According to the Configure and run cron guide for Magento 2 developers, the crontab.xmi file is used to declare and configure cron jobs for a module. The file should specify the name, instance, method and schedule of the cron job. Therefore, creating a crontab.xmi file and setting a schedule for the new cron job are the minimally required steps to accomplish this task. Verified Reference: https://devdocs.magento.com/guides/v2.3/config-guide/cli/config-cli-subcommands-cron.html


質問 # 30
An Adobe Commerce Cloud project is using Enhanced Integration Environments with two install a new payment module.
The developer is using Cloud CLI for Commerce tool.
What would a developer do to test this new feature under the integration environment?

  • A. 1. Duplicate one of the integration environment branches.
    2. Create a new active branch from integration and install the module.
    3. Push the changes.
  • B. 1. Deactivate one of the active integration environment branches.
    2. Create a new active branch from integration and install the module.
    3. Push the changes.
  • C. 1. Create a new branch from integration and install the module.
    2. Push the changes.
    3. Branch active status check is not necessary.

正解:B

解説:
The developer can test the new feature under the integration environment by deactivating one of the active integration environment branches, creating a new active branch from integration and installing the module, and pushing the changes. This is because Enhanced Integration Environments have a limit of four active branches at a time, and each branch has its own dedicated database and services. The developer can use the Cloud CLI for Commerce tool to manage the branches and deploy the code changes. Verified Reference: [Magento 2.4 DevDocs] 1


質問 # 31
An Adobe Commerce Developer wishes to add an action to a pre-existing route, but does not wish to interfere with the functionality of the actions from the original route.
What must the developer do to ensure that their action works without any side effects in the original module?

  • A. Inject the new action into the standard router constructor's $actiomist parameter.
  • B. In the route declaration, use the before or after parameters to load their module in before or after the original module.
  • C. Add the action into to the controllers/front_name/ in My.Module, Magento will automatically detect and use it.

正解:B

解説:
To add an action to a pre-existing route without interfering with the functionality of the original route, the developer must use the before or after parameters in the route declaration. This will load the developer's module in before or after the original module, respectively.
For example, the following code would add an action to the my_module/index route before the action from the original module:
<route id="my_module/index">
<before>my_module_before</before>
<action class="MyModule\Controller\Index">
<arguments>
<argument name="context" type="Magento\Framework\App\Action\Context"/>
</arguments>
</action>
</route>
The my_module_before action would be executed before the MyModule\Controller\Index action, which would allow the developer to perform any necessary setup before the original action is executed.


質問 # 32
An Adobe Commerce Cloud developer wants to be sure that, even after transferring database from Production to Staging, the payment configurations are still valid on the Staging environment.
What does the developer need to add to be sure that the configurations are always properly set?

  • A. Project level environment variables.
  • B. Lines in the dedicated core_conf ig_data_stg table.
  • C. Environment level environment variables.

正解:C

解説:
The developer needs to add environment level environment variables to be sure that the payment configurations are always properly set on the Staging environment. Environment variables are configuration settings that affect the behavior of the Adobe Commerce Cloud application and services. Environment variables can be set at the project level or the environment level. Project level variables apply to all environments, while environment level variables override the project level variables for a specific environment. The developer can use environment level variables to customize the payment configurations for the Staging environment without affecting other environments. Verified Reference: [Magento 2.4 DevDocs]


質問 # 33
A merchant is experiencing performance issues on integration environments of their Adobe Commerce Cloud Pro plan and wants to upgrade to Enhanced Integration Environments.
What are the steps necessary prior to redeploying in order to upgrade to Enhanced Integration Environments?

  • A. 1. Limit the number of Integration branches to two
    2. Submit a support ticket requesting the upgrade
  • B. 1. Limit the number of Integration branches to three
    2. Set the ENV.ENVIRONMENT in .magento.env.yaml to ENHANCEDJNTEGRATION
  • C. 1. Limit the number of Integration branches to four
    2. Configure integration environments in the cloud GUI and set the Enhanced switch to On

正解:A

解説:
The steps necessary prior to redeploying in order to upgrade to Enhanced Integration Environments are to limit the number of integration branches to two and to submit a support ticket requesting the upgrade. Enhanced Integration Environments are an improved version of integration environments that offer better performance, stability, and security. They have a limit of four active branches at a time, but only two branches can be migrated from standard integration environments. The developer needs to delete or deactivate any extra branches before requesting the upgrade from Adobe support. Verified Reference: [Magento 2.4 DevDocs]


質問 # 34
When attempting operations that require lengthy processing, a merchant on Adobe Commerce Cloud receives a timeout error after 180 seconds.
How would the developer deal with this issue?

  • A. 1. Modify admin timeout into app/etc/config.php file.
    2. Commit and push that code from the local environment.
    3. Submit a support ticket to apply the changes.
  • B. 1. Modify admin timeout into .magento.app.yamifile.
    2. Commit and push that code from the local environment.
    3. Move code to Production environment.
  • C. 1. In the Fastly Configuration section > Advanced Configuration.
    2. Set the Admin path timeout value in seconds.
    3. Save config and Upload VCL to Fastly.

正解:C

解説:
The developer can deal with this issue by modifying the admin path timeout value in seconds in the Fastly Configuration section > Advanced Configuration in the Admin Panel. Fastly is a cloud-based caching service that improves site performance and security for Adobe Commerce Cloud projects. Fastly has a default timeout value of 180 seconds for admin requests, which means that any request that takes longer than 180 seconds will be terminated and result in a timeout error. The developer can increase this value to allow longer processing time for admin requests without causing errors. The developer also needs to save the configuration and upload VCL to Fastly to apply the changes. Verified Reference: [Magento 2.4 DevDocs]


質問 # 35
An Adobe Commerce Cloud merchant has been experiencing significant downtime during production deployment. They have already checked that the application is in ideal state.
In addition to the configuration of the SCD.MATRIX variable to reduce amount of unnecessary theme files, what would be the next steps to reduce the downtime?

  • A. 1. Check SCD is configured under the build phase.
    2. Increase the SCD.THREADS to speed up the build process.
  • B. 1. Check SCD is configured under the build phase.
    2. Check if Adobe Commerce Cloud automatically adjusts SCD.THREADS.
  • C. 1. Check SCD is configured under deploy phase.
    2. Decrease the SCD.THREADS to speed up the build process

正解:A

解説:
The next steps to reduce the downtime are to check that the SCD is configured under the build phase and to increase the SCD.THREADS to speed up the build process. The SCD stands for static content deployment, which is the process of generating and deploying static files such as CSS, JS, images, etc. By configuring the SCD under the build phase, the static files are generated before the code is deployed to the production environment, which reduces the downtime during deployment. The SCD.THREADS is a variable that determines how many threads are used for parallel processing during the SCD. By increasing the SCD.THREADS, the developer can improve the performance and efficiency of the SCD process. Verified Reference: [Magento 2.4 DevDocs] 12


質問 # 36
An Adobe Commerce developer is working on a Magento 2 instance which contains a B2C and a B2B website, each of which contains 3 different store views for English, Welsh, and French language users. The developer is tasked with adding a link between the B2C and B2B websites using a generic link template which is used throughout the sites, but wants these links to display in English regardless of the store view.
The developer creates a custom block for use with this template, before rendering sets the translate locale and begins environment emulation using the following code:

They find that the template text is still being translated into each stores language. Why does this occur?

  • A. startEnvironmentEmuiation() resets the translation locale to the one of the emulated stores, which overrides the locale the developer has set when the order of setLocate and startEnvironmentEmulation is used as displayed above.
  • B. setLocate() does not change translation locale after it has been initially set, the $this->_translate->emulate($newLocaiecode) method exists to temporarily modify this by pushing the new locale to the top of the current emuiatedLocales stack.
  • C. startEnvironmffntEmulation() SetS and locks the locale by Using the setLocale() Optional Second $lock parameter, i.e. setLocale($newLocaleCode, true), to override and lock the locale of the emulated store. If this is set and locked initially then the environment emulation will not be able to override this.

正解:A

解説:
The startEnvironmentEmulation() method resets the translation locale to the one of the emulated stores, which overrides the locale the developer has set when the order of setLocale() and startEnvironmentEmulation() is used as displayed above.
The correct way to achieve the desired result is to use the emulate() method to temporarily modify the translation locale. The following code shows how to do this:
PHP
$this->_translate->emulate('en_US');
// Render the template
$this->_translate->revert();
This code will set the translation locale to English before rendering the template, and then revert the locale back to the default value after the template has been rendered.
The startEnvironmentEmulation() method is used to emulate a different store view or website. This can be useful for testing purposes, or for developing features that need to work in different environments.
The emulate() method is used to temporarily modify the translation locale. This can be useful for rendering templates in a specific language, or for testing features that need to work in different languages.


質問 # 37
An Adobe Commerce developer has created a process that exports a given order to some external accounting system. Launching this process using the Magento CLI with the command php bin/magento my_module:order: process --order_id=<order_id> is required.
Example: php bin/magento my_module:order:process --order_id=1245.
What is the correct way to configure the command?

  • A.
  • B.
  • C.
  • D.

正解:D

解説:
According to the How to use the Magento command-line interface (CLI) guide, to configure and run the Magento CLI, the developer needs to make the bin/magento file executable and then use it to run commands. To create a custom command, the developer needs to create a class that implements \Symfony\Component\Console\Command\Command and define its name, description, arguments, options, and logic. The developer also needs to register the command in the di.xml file of their module using the Magento\Framework\Console\CommandList argument. Therefore, option C is the correct answer, as it shows the correct class and di.xml code to configure the custom command. Verified Reference: https://www.a2hosting.com/kb/installable-applications/optimization-and-configuration/magento1/using-the-magento-command-line-interface-cli/


質問 # 38
An Adobe Commerce developer is tasked with adding custom data to orders fetched from the API. While keeping best practices in mind, how would the developer achieve this?

  • A. Create a before plugin on Magento\sales\model\ResourceModel\order\collection: :load and alter the query to fetch the additional data. Data will then be automatically added to the items fetched from the API.
  • B. Create an extension attribute On Magento\Sales\Api\Data\OrderInterface and an after plugin On Magento\Sales\Api\OrderRepositoryInterface On geto and getListo to add the custom data.
  • C. Create an extension attribute on Nagento\sales\Api\E)ata\orderinterface and an after plugin on Magento\Sales\Model\Order: :getExtensionAttributes() to add the custom data.

正解:B

解説:
The developer should create an extension attribute on the Magento\Sales\Api\Data\OrderInterface interface and an after plugin on the Magento\Sales\Api\OrderRepositoryInterface::get() and Magento\Sales\Api\OrderRepositoryInterface::getList() methods.
The extension attribute will store the custom data. The after plugin will be used to add the custom data to the order object when it is fetched from the API.
Here is the code for the extension attribute and after plugin:
PHP
namespace MyVendor\MyModule\Api\Data;
interface OrderExtensionInterface extends \Magento\Sales\Api\Data\OrderInterface
{
/**
* Get custom data.
* * @return string|null
*/
public function getCustomData();
/**
* Set custom data.
* * @param string $customData
* @return $this
*/
public function setCustomData($customData);
}
namespace MyVendor\MyModule\Model;
class OrderRepository extends \Magento\Sales\Api\OrderRepositoryInterface
{
/**
* After get order.
* * @param \Magento\Sales\Api\OrderRepositoryInterface $subject
* @param \Magento\Sales\Api\Data\OrderInterface $order
* @return \Magento\Sales\Api\Data\OrderInterface
*/
public function afterGetOrder($subject, $order)
{
if ($order instanceof OrderExtensionInterface) {
$order->setCustomData('This is custom data');
}
return $order;
}
/**
* After get list.
* * @param \Magento\Sales\Api\OrderRepositoryInterface $subject
* @param \Magento\Sales\Api\Data\OrderInterface[] $orders
* @return \Magento\Sales\Api\Data\OrderInterface[]
*/
public function afterGetList($subject, $orders)
{
foreach ($orders as $order) {
if ($order instanceof OrderExtensionInterface) {
$order->setCustomData('This is custom data');
}
}
return $orders;
}
}
Once the extension attribute and after plugin are created, the custom data will be added to orders fetched from the API.


質問 # 39
The di. xml file of a module attaches two plugins for the class Action.

The around plugin code is:

What would be the plugin execution order?

  • A.
  • B.
  • C.

正解:A

解説:
The plugin execution order is as follows:
PluginA::beforeDispatch()
PluginB::beforeDispatch()
PluginA::aroundDispatch()
The code in the around plugin
PluginB::afterDispatch()
PluginA::afterDispatch()
The aroundDispatch() method is executed in a separate scope, so the code in the around plugin will be executed after the beforeDispatch() methods of both plugins, but before the afterDispatch() methods of both plugins.
Here is a diagram that shows the plugin execution order:
PluginA
beforeDispatch()
aroundDispatch()
afterDispatch()
PluginB
beforeDispatch()
afterDispatch()


質問 # 40
An Adobe Commerce developer is asked to change the tracking level on a custom module for free downloading of pdf and images.
The module contains following models:
Download class has a parameter for tracking_level.
How will the developer configure the tracking_level parameter, in di.xml.to have a value of 4 for Download class and all classes that extend Download?

  • A.
  • B.
  • C.

正解:A

解説:
To configure the tracking_level parameter in di.xml to have a value of 4 for the Download class and all classes that extend Download, the developer would use the following code:
<config>
<global>
<models>
<Vendor\FreeDownload\Model\Download>
<setting name="tracking_level" value="4"/>
</Vendor\FreeDownload\Model\Download>
<Vendor\FreeDownload\Model\DownloadPdf>
<rewrite name="tracking_level" value="4"/>
</Vendor\FreeDownload\Model\DownloadPdf>
<Vendor\FreeDownload\Model\DownloadImage>
<rewrite name="tracking_level" value="4"/>
</Vendor\FreeDownload\Model\DownloadImage>
</models>
</global>
</config>
The setting element is used to set a configuration value for a specific model. The rewrite element is used to override the default configuration value for a specific model. In this case, the tracking_level parameter is set to 4 for all models that extend Download.


質問 # 41
An Adobe Commerce developer creates a new website using a data patch. Each website will have unique pricing by website. The developer does not have visibility into the production and staging environments so they do not know what the configuration currently is.
How would they ensure the configuration is deployed and consistent across all environments?
A)


  • A. Option B
  • B. Option C
  • C. Option A

正解:A

解説:
To ensure that the configuration is deployed and consistent across all environments, the developer can use the following steps:
Create a data patch that contains the configuration for the new website.
Deploy the data patch to all environments.
Use the magento deploy:status command to verify that the configuration has been deployed to all environments.


質問 # 42
The developer is required to convert a modules database scripts from old install/upgrade setup files to a data patches format and does not want to apply database changes that were already done by install/upgrade scripts.
The current module version is 1.5.4.
What would be the recommended solution to skip changes that were already applied via old format (install/upgrade scripts)?

  • A. Implement Patchversioninterface and return 1.5.4 on the getversion() method.
  • B. This is not possible. A module cannot implement both data patch and install scripts.
  • C. Inside apply() method, check for module version and run the code if version is less than 1.5.4.

正解:A

解説:
According to the Develop data and schema patches guide for Magento 2 developers, data patches are classes that contain data modification instructions. They are defined in a <Vendor>/<Module_Name>/Setup/Patch/Data/<Patch_Name>.php file and implement MagentoFrameworkSetupPatchDataPatchInterface. Data patches can also implement Patchversioninterface to specify the module version that the patch is associated with. The getVersion() method returns the module version as a string. To skip changes that were already applied via old format (install/upgrade scripts), the developer should implement Patchversioninterface and return 1.5.4 on the getVersion() method. This way, the data patch will only be applied if the module version is greater than or equal to 1.5.4. Verified Reference: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/data-patches.html


質問 # 43
A Project Architect needs to add a new developer who needs to be able to push code in an Adobe Commerce Cloud project. No integration with a third-party repository provider is setup.
What two actions would be required to ensure the developer has access? (Choose Two.)

  • A. The developer needs to add SSH public key in the Cloud Account dashboard settings
  • B. The developer's email must be added under Users in the Cloud Project Web Ul
  • C. The Adobe Commerce admin user must be created and the developer's SSH public key must be added on their local system
  • D. The developer's SSH public key must be added into a file named ~/.ssh/authorized_keys

正解:A、B

解説:
To ensure the developer has access to push code in an Adobe Commerce Cloud project, the developer's email must be added under Users in the Cloud Project Web UI and the developer needs to add SSH public key in the Cloud Account dashboard settings. The Cloud Project Web UI is a web interface that allows managing and configuring Adobe Commerce Cloud projects and environments. The developer's email must be added under Users to grant them access to the project and assign them a role and permissions. The Cloud Account dashboard settings is a web interface that allows managing and configuring Adobe Commerce Cloud accounts and SSH keys. The developer needs to add SSH public key in the settings to enable secure connection to the project and environments via SSH. Verified Reference: [Magento 2.4 DevDocs]


質問 # 44
How would a developer turn on outgoing emails on an Adobe Commerce Cloud Staging environment?

  • A. Access the Project Web Interface and select the Staging environment.
    Select Configure environment.
  • B. From the command line
    magento-cloud environment:info -p <project-id> -e <environment-id> enable_smtp true
  • C. From the command line
    ece-tools enable_smtp true

正解:A

解説:
Toggle Outgoing emails On
Explanation:
The developer can turn on outgoing emails on an Adobe Commerce Cloud Staging environment by accessing the Project Web Interface and selecting the Staging environment. Then, the developer can select Configure environment and toggle Outgoing emails On. This will enable the SMTP service for the Staging environment and allow emails to be sent from the application. Verified Reference: [Magento 2.4 DevDocs] 1


質問 # 45
An Adobe Commerce developer is creating a new console command to perform a complex task with a lot of potential terminal output. If an error occurs, they want to provide a message that has higher visibility than some of the other content that may be appearing, so they want to ensure it is highlighted in red (as seen in the screenshot):

How can they customize the appearance of this message?

  • A. Call the setDecorationType(Stype) method On the Symfony\Console\Output\OutputInterface Object before Calling writeln().
  • B. Throw a new commandException with the desired message passed as an argument.
  • C. Wrap the output content in tags like <error>, <info>, or <comment>.

正解:A

解説:
The developer can customize the appearance of the error message by calling the setDecorationType() method on the Symfony\Console\Output\OutputInterface object before calling writeln(). The setDecorationType() method takes a single argument, which is the type of decoration that the developer wants to use. In this case, the developer wants to use the STYPE_ERROR decoration, which will highlight the message in red.
Here is an example of how to customize the appearance of the error message:
$output = new Symfony\Console\Output\ConsoleOutput();
$output->setDecorationType(Symfony\Console\Output\OutputInterface::STYPE_ERROR);
$output->writeln('This is an error message.');
The output of this code will be an error message that is highlighted in red.


質問 # 46
An Adobe Commerce developer is writing an integration test. They checked some Integration Tests for Magento core modules for reference and noticed that they use data fixtures initialized by adding annotations to test classes. For example:

The developer wants to add their own fixture to test a MyVendor_MyModule they created. Which steps will make this possible?

  • A. 1. Create a PHP file With the fixture data in [magento root dir]/dev/tests/integration/testsuite/MyVendor/MyModule/_files/my_fixture.php.
    2. Add the following annotation to the test method:
  • B. 1. Create a PHP file with the fixture data inside their own module in [module dir]/Test/integration/_f iies/my_f ixture.php.
    2. Add the following annotation to the test method:
  • C. 1. Create a PHP file with the fixture data inside their own module in [module dir]/Test/integration/_fiies/my_fixture.php.
    2. Add the following annotation to the test method:

正解:A

解説:
To add a custom fixture to test a MyVendor_MyModule, the developer needs to do the following:
Create a PHP file with the fixture data in [magento root dir]/dev/tests/integration/testsuite/MyVendor/MyModule/_files/my_fixture.php.
Add the following annotation to the test method:
@magentoDataFixture(
'testsuite/MyVendor/MyModule/_files/my_fixture.php'
)
This will tell Magento to load the fixture data from the my_fixture.php file before the test method is executed.


質問 # 47
A message queue currently has queue/consumer-wait-for-messages set to true, which allows the consumer process to run until a message is inserted into the queue. A piece of functionality is driven by data stored in the model
\Magento\variable\Model\variable and this value is only loaded once during the consumer run. If the variable is updated we want the consumer to restart so that the new value is loaded into memory without having to reload the variable on each message consumed.
The Adobe Commerce developer has created an after plugin on the \Magento\Variable\Model\variable:: save() function.
How would the developer use the plugin to trigger the consumer restart?

  • A. Set the global Cache key trigger_consumer_restart t0 1.
  • B. Call the function \Magento\Framework\MessageQueue\PoisonPill\Poi5onPillPutInterface::put().
  • C. Call the function \Magento\Framework\MessageQueue\Consumers\TriggerRe5tartInterface:trigger().

正解:C

解説:
The developer can use the plugin to trigger the consumer restart by calling the function \Magento\Framework\MessageQueue\Consumers\TriggerRe5tartInterface:trigger(). This function will write a flag to the cache storage that will be checked by the consumer process. If the flag is set, the consumer process will terminate itself and restart with the updated configuration. Verified Reference: [Magento 2.4 DevDocs] 1


質問 # 48
An Adobe Commerce developer has created a module that adds a product attribute to all product types via a Data Patch-According to best practices, how would the developer ensure this product attribute is removed in the event that the module is uninstalled at a later date?

  • A. Add instructions to the module's README.md file instructing merchants and developers that they must manually remove this attribute if they want to uninstall the module.
  • B. Add an Uninstall.php file extending \l1agento\Framework\Setup\UninstallInterface tO the module's Setup directory and implement the uninstall method.
  • C. Make the Data Patch implement \Magento\Framework\setup\Patch\PatchRevertabieinterface and implement the revert method to remove the product attribute.

正解:C

解説:
According to the Develop data and schema patches guide for Magento 2 developers, data patches can also implement PatchRevertabieinterface to provide rollback functionality for their changes. The revert() method contains the instructions to undo the data modifications made by the patch. To ensure that the product attribute is removed when the module is uninstalled, the developer should make the data patch implement PatchRevertabieinterface and implement the revert method to remove the product attribute using EavSetupFactory or AttributeRepositoryInterface. Verified Reference: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/data-patches.html


質問 # 49
An Adobe Commerce developer is creating a module (Vendor.ModuleName) to be sold on the Marketplace. The new module creates a database table using declarative schema and now the developer needs to make sure the table is removed when the module is disabled.
What must the developer do to accomplish this?

  • A. There is nothing further the developer needs to do. The table will be removed when the when bin/magento module:uninstall vendor_ModuleName is run.
  • B. There is nothing further the developer needs to do. The table will be removed when the module is disabled and bin/magento setup:upgrade is run.
  • C. Add a schema patch that implements Magento\Framework\setup\Patch\PatchRevertabieinterface and drops the table in the revert function.

正解:C

解説:
According to the Declarative Schema Overview guide for Magento 2 developers, declarative schema is a new feature that allows developers to declare the final desired state of the database and has the system adjust to it automatically, without performing redundant operations. However, declarative schema does not support uninstalling modules or reverting changes. To remove a table when a module is disabled, the developer needs to add a schema patch that implements Magento\Framework\setup\Patch\PatchRevertabieinterface and drops the table in the revert function. The revert function will be executed when the module is disabled using bin/magento module:disable command. Verified Reference: https://devdocs.magento.com/guides/v2.3/extension-dev-guide/declarative-schema/


質問 # 50
......

Adobe AD0-E716問題を提供していますAdobe Commerce問題集と完璧な解答付き:https://www.jpntest.com/shiken/AD0-E716-mondaishu

信頼され続けるAD0-E716試験のコツとPDF試験材料:https://drive.google.com/open?id=1nU_MBtENN64gBv4AaS5dPr9Yku3sZ14c

弊社を連絡する

我々は12時間以内ですべてのお問い合わせを答えます。

オンラインサポート時間:( UTC+9 ) 9:00-24:00
月曜日から土曜日まで

サポート:現在連絡