classes/XLite/Model/Image/Common/Logo.php line 18

Open in your IDE?
  1. <?php
  2. /**
  3.  * Copyright (c) 2011-present Qualiteam software Ltd. All rights reserved.
  4.  * See https://www.x-cart.com/license-agreement.html for license details.
  5.  */
  6. namespace XLite\Model\Image\Common;
  7. use Doctrine\ORM\Mapping as ORM;
  8. /**
  9.  * Content images file storage
  10.  *
  11.  * @ORM\Entity
  12.  * @ORM\Table  (name="logo_images")
  13.  */
  14. class Logo extends \XLite\Model\Base\Image
  15. {
  16.     /**
  17.      * Get path
  18.      *
  19.      * @return string
  20.      */
  21.     public function getPath()
  22.     {
  23.         $webRootPrefix strpos($this->path'public/') !== 'public/' '';
  24.         return $webRootPrefix $this->path;
  25.     }
  26.     /**
  27.      * Alternative image text
  28.      *
  29.      * @var string
  30.      */
  31.     protected $alt '';
  32.     /**
  33.      * Set alt
  34.      *
  35.      * @param string $alt
  36.      */
  37.     public function setAlt($alt)
  38.     {
  39.         $this->alt $alt;
  40.     }
  41.     /**
  42.      * Get alt
  43.      *
  44.      * @return string
  45.      */
  46.     public function getAlt()
  47.     {
  48.         return $this->alt;
  49.     }
  50.     /**
  51.      * Check - image is exists in DB or not
  52.      *
  53.      * @return boolean
  54.      */
  55.     public function isExists()
  56.     {
  57.         return true;
  58.     }
  59.     /**
  60.      * Resize on view
  61.      *
  62.      * @return boolean
  63.      */
  64.     protected function isUseDynamicImageResizing()
  65.     {
  66.         return $this->getMime() ? !array_key_exists($this->getMime(), static::$extendedTypes) : true;
  67.     }
  68. }