Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/vendor/mageworx/module-seobase/Model/Robots/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/vendor/mageworx/module-seobase/Model/Robots/Product.php
<?php
/**
 * Copyright © 2015 MageWorx. All rights reserved.
 * See LICENSE.txt for license details.
 */

namespace MageWorx\SeoBase\Model\Robots;

use MageWorx\SeoBase\Helper\Data as HelperData;
use Magento\Framework\Registry;
use Magento\Framework\App\RequestInterface;
use Magento\Framework\UrlInterface;

/**
 * SEO Base product robots model
 */
class Product extends \MageWorx\SeoBase\Model\Robots
{
    /**
     * @var \Magento\Framework\Registry
     */
    protected $registry;

    /**
     *
     * @param HelperData $helperData
     * @param Registry $registry
     * @param RequestInterface $request
     * @param UrlInterface $url
     */
    public function __construct(
        HelperData $helperData,
        Registry $registry,
        RequestInterface $request,
        UrlInterface $url,
        $fullActionName
    ) {
    
        $this->registry = $registry;
        parent::__construct($helperData, $request, $url, $fullActionName);
    }

    /**
     * Retrieve final robots
     *
     * @return string
     */
    public function getRobots()
    {
        $metaRobots = $this->getProductRobots();
        return $metaRobots ? $metaRobots : $this->getRobotsBySettings();
    }

    /**
     * Retrieve robots from product atttibute
     *
     * @return string|null
     */
    protected function getProductRobots()
    {
        $product = $this->registry->registry('current_product');
        if (is_object($product) && $product->getMetaRobots()) {
            return $product->getMetaRobots();
        }
        return null;
    }
}

Spamworldpro Mini