當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Category::persist方法代碼示例

本文整理匯總了PHP中Magento\Catalog\Test\Fixture\Category::persist方法的典型用法代碼示例。如果您正苦於以下問題:PHP Category::persist方法的具體用法?PHP Category::persist怎麽用?PHP Category::persist使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Magento\Catalog\Test\Fixture\Category的用法示例。


在下文中一共展示了Category::persist方法的11個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __prepare

 /**
  * Prepare data.
  *
  * @param Category $category
  * @param CatalogProductIndex $productGrid
  * @param CatalogProductEdit $editProductPage
  * @param FixtureFactory $fixtureFactory
  * @return void
  */
 public function __prepare(Category $category, CatalogProductIndex $productGrid, CatalogProductEdit $editProductPage, FixtureFactory $fixtureFactory)
 {
     $this->category = $category;
     $this->category->persist();
     $this->productGrid = $productGrid;
     $this->editProductPage = $editProductPage;
     $this->fixtureFactory = $fixtureFactory;
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:17,代碼來源:DuplicateProductEntityTest.php

示例2: __construct

 /**
  * @param Config $configuration
  * @param array $placeholders
  */
 public function __construct(Config $configuration, array $placeholders = array())
 {
     parent::__construct($configuration, $placeholders);
     $this->_placeholders['rewritten_category_request_path'] = array($this, 'getRewrittenRequestPath');
     $this->_repository = Factory::getRepositoryFactory()->getMagentoUrlRewriteUrlRewriteCategory($this->_dataConfig, $this->_data);
     $this->category = Factory::getFixtureFactory()->getMagentoCatalogCategory();
     $this->category->persist();
 }
開發者ID:aiesh,項目名稱:magento2,代碼行數:12,代碼來源:UrlRewriteCategory.php

示例3: __construct

 /**
  * @constructor
  * @param FixtureFactory $fixtureFactory
  * @param array $params
  * @param array|int $data
  */
 public function __construct(FixtureFactory $fixtureFactory, array $params, $data = [])
 {
     $this->params = $params;
     if (isset($data['dataSet']) && $data['dataSet'] !== '-') {
         $this->parentCategory = $fixtureFactory->createByCode('category', ['dataSet' => $data['dataSet']]);
         if (!$this->parentCategory->hasData('id')) {
             $this->parentCategory->persist();
         }
         $this->data = $this->parentCategory->getId();
     } else {
         $this->data = $data;
     }
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:19,代碼來源:ParentId.php

示例4: test

 /**
  * Delete category
  *
  * @param Category $category
  * @return void
  */
 public function test(Category $category)
 {
     $category->persist();
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category);
     $this->catalogCategoryEdit->getFormPageActions()->delete();
 }
開發者ID:shabbirvividads,項目名稱:magento2,代碼行數:13,代碼來源:DeleteCategoryEntityTest.php

示例5: processAssert

 /**
  * Assert that apache redirect works by opening category page and asserting index.php in its url
  *
  * @param Category $category
  * @param CmsIndex $homePage
  * @param BrowserInterface $browser
  */
 public function processAssert(Category $category, CmsIndex $homePage, BrowserInterface $browser)
 {
     $category->persist();
     $homePage->open();
     $homePage->getTopmenu()->selectCategoryByName($category->getName());
     \PHPUnit_Framework_Assert::assertTrue(strpos($browser->getUrl(), 'index.php') === false, 'Apache redirect for category does not work.');
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:14,代碼來源:AssertRewritesEnabled.php

示例6: __inject

 /**
  * Inject page end prepare default category
  *
  * @param Category $initialCategory
  * @param CatalogCategoryIndex $catalogCategoryIndex
  * @param CatalogCategoryEdit $catalogCategoryEdit
  * @return array
  */
 public function __inject(Category $initialCategory, CatalogCategoryIndex $catalogCategoryIndex, CatalogCategoryEdit $catalogCategoryEdit)
 {
     $this->catalogCategoryIndex = $catalogCategoryIndex;
     $this->catalogCategoryEdit = $catalogCategoryEdit;
     $initialCategory->persist();
     return ['initialCategory' => $initialCategory];
 }
開發者ID:pradeep-wagento,項目名稱:magento2,代碼行數:15,代碼來源:UpdateCategoryEntityTest.php

示例7: test

 /**
  * Filtering product in the Frontend via layered navigation.
  *
  * @param string $configData
  * @param Category $category
  * @return array
  */
 public function test($configData, Category $category)
 {
     $this->configData = $configData;
     // Preconditions
     $this->objectManager->create('Magento\\Config\\Test\\TestStep\\SetupConfigurationStep', ['configData' => $this->configData])->run();
     // Steps
     $category->persist();
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:15,代碼來源:FilterProductListTest.php

示例8: __inject

 /**
  * Prepare datasets and pages
  *
  * @param UrlRewriteIndex $urlRewriteIndex
  * @param UrlRewriteEdit $urlRewriteEdit
  * @param FixtureFactory $fixtureFactory
  * @param Category $category
  * @return array
  */
 public function __inject(UrlRewriteIndex $urlRewriteIndex, UrlRewriteEdit $urlRewriteEdit, FixtureFactory $fixtureFactory, Category $category)
 {
     $this->urlRewriteIndex = $urlRewriteIndex;
     $this->urlRewriteEdit = $urlRewriteEdit;
     $category->persist();
     $categoryRedirect = $fixtureFactory->createByCode('urlRewrite', ['dataset' => 'default', 'data' => ['target_path' => $category->getUrlKey() . '.html']]);
     $categoryRedirect->persist();
     return ['categoryRedirect' => $categoryRedirect, 'category' => $category];
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:18,代碼來源:UpdateCategoryUrlRewriteEntityTest.php

示例9: test

 /**
  * Delete category.
  *
  * @param Category $category
  * @return void
  */
 public function test(Category $category)
 {
     $category->persist();
     $this->catalogCategoryIndex->open();
     $this->catalogCategoryIndex->getTreeCategories()->selectCategory($category);
     if ($this->catalogCategoryEdit->getFormPageActions()->checkDeleteButton()) {
         $this->catalogCategoryEdit->getFormPageActions()->delete();
         $this->catalogCategoryEdit->getModalBlock()->acceptAlert();
     }
 }
開發者ID:Zash22,項目名稱:magento,代碼行數:16,代碼來源:DeleteCategoryEntityTest.php

示例10: processAssert

 /**
  * Assert that widget with type Recently Viewed Products is present on category page
  *
  * @param CmsIndex $cmsIndex
  * @param AdminCache $adminCache
  * @param CatalogCategoryView $catalogCategoryView
  * @param BrowserInterface $browser
  * @param CatalogProductSimple $productSimple
  * @param Category $category
  * @param Customer $customer
  * @return void
  */
 public function processAssert(CmsIndex $cmsIndex, AdminCache $adminCache, CatalogCategoryView $catalogCategoryView, BrowserInterface $browser, CatalogProductSimple $productSimple, Category $category, Customer $customer)
 {
     $this->browser = $browser;
     $this->cmsIndex = $cmsIndex;
     $this->catalogCategoryView = $catalogCategoryView;
     // Flush cache
     $adminCache->open();
     $adminCache->getActionsBlock()->flushMagentoCache();
     $adminCache->getMessagesBlock()->waitSuccessMessage();
     // Log in customer
     $customer->persist();
     $this->objectManager->create('Magento\\Customer\\Test\\TestStep\\LoginCustomerOnFrontendStep', ['customer' => $customer])->run();
     // Open products
     $productSimple->persist();
     $category->persist();
     $this->browser->open($_ENV['app_frontend_url'] . $productSimple->getUrlKey() . '.html');
     $this->checkRecentlyViewedBlockOnCategory($productSimple, $category);
 }
開發者ID:kidaa30,項目名稱:magento2-platformsh,代碼行數:30,代碼來源:AssertWidgetRecentlyViewedProducts.php

示例11: __prepare

 /**
  * Prepare data.
  *
  * @param Category $category
  * @return array
  */
 public function __prepare(Category $category)
 {
     $category->persist();
     return ['category' => $category];
 }
開發者ID:andrewhowdencom,項目名稱:m2onk8s,代碼行數:11,代碼來源:DeleteProductEntityTest.php


注:本文中的Magento\Catalog\Test\Fixture\Category::persist方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。