タグ付けされた質問 「magento-2.0.5」

4
抽象モデルの非推奨の保存およびロードメソッド
Magento 2リポジトリの開発ブランチでは、メソッドloadとsavefrom Magento\Framework\Model\AbstractModelクラスが非推奨になっていることがわかります。 しかし、コアには、このクラスを拡張してandを使用する膨大な数のクラスがsaveありloadます。 エンティティのCRUD部分に独自のモジュールを作成するとき、コアモジュールと同じガイドラインに従います。 しかし、これらのメソッドは非推奨であるため、将来に備えたいと思います。 それらの代わりに何を使うべきですか?または、他の何かを拡張する必要がありますか?

2
Magento 2:catalog_attributes.xmlファイルとは何ですか?
Magento 2 catalog_attributes.xmlの次のフォルダーにいくつかのファイルが含まれていることに気付きました。 app/code/Magento/Bundle/etc app/code/Magento/Catalog/etc app/code/Magento/CatalogSearch/etc app/code/Magento/CatalogUrlRewrite/etc app/code/Magento/Downloadable/etc app/code/Magento/GiftMessage/etc app/code/Magento/Msrp/etc app/code/Magento/Sales/etc app/code/Magento/Tax/etc app/code/Magento/Wishlist/etc これらのファイルは次のようになりSalesます(ファイルの例): <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Catalog:etc/catalog_attributes.xsd"> <group name="quote_item"> <attribute name="sku"/> <attribute name="type_id"/> <attribute name="name"/> <attribute name="status"/> <attribute name="visibility"/> <attribute name="price"/> <attribute name="weight"/> <attribute name="url_path"/> <attribute name="url_key"/> <attribute name="thumbnail"/> <attribute name="small_image"/> <attribute name="tax_class_id"/> <attribute name="special_from_date"/> <attribute name="special_to_date"/> <attribute name="special_price"/> <attribute …

8
パッケージfabpot / php-cs-fixerは、Magento 2で放棄されたメッセージです
Magento 2.0.5を使用しています。composer updateまたはcomposer installコマンドを実行すると、次の警告が表示されます。 パッケージfabpot / php-cs-fixerは廃止されました。使用しないでください。代わりにfriendsofphp / php-cs-fixerを使用してください。 https://github.com/paliarush/magento2-vagrant-for-developers/issues/46を読みましたが、何も取得できませんでした。

3
Magento 2-現在の日付を取得するためのベストプラクティス
updated_atカスタムエンティティの属性を保存し、Magento 2がそれをどのように処理するかを調べたベストプラクティスを知る必要があります。 私は\Magento\Eav\Model\Entity\Attribute\Backend\Time\Updated属性バックエンドモデルクラスを見て、ここにコードがあります: public function beforeSave($object) { $object->setData( $this->getAttribute()->getAttributeCode(), (new \DateTime())->format(\Magento\Framework\Stdlib\DateTime::DATETIME_PHP_FORMAT) ); return $this; } 私の最初の疑問は、どのタイムゾーンが考慮に入れられるかです。 DateTimeコンストラクタのシグネチャは次のとおりです。 public DateTime::__construct ([ string $time = "now" [, DateTimeZone $timezone = NULL ]] ) コンストラクタのドキュメントによると: $ timezoneを省略すると、現在のタイムゾーンが使用されます。 現在のタイムゾーンはサーバーレベルで構成されているタイムゾーンだと思います。 それを証明するには、次のPHPスニペットを実行します。 <?php var_dump(new DateTime()); 期待される結果は次のとおりです。 object(DateTime)#1 (3) { ["date"]=> string(26) "2016-05-10 12:47:11.000000" ["timezone_type"]=> int(3) ["timezone"]=> …
弊社のサイトを使用することにより、あなたは弊社のクッキーポリシーおよびプライバシーポリシーを読み、理解したものとみなされます。
Licensed under cc by-sa 3.0 with attribution required.