Overview

Namespaces

  • Charcoal
    • Admin
      • Widget
        • Cms
    • Cms
      • Config
      • Mixin
        • Traits
      • Route
      • Section
      • Service
        • Loader
        • Manager
      • ServiceProvider
      • Support
        • Helpers
        • Interfaces
        • Traits
    • Property

Classes

  • Charcoal\Admin\Widget\Cms\HierarchicalSectionTableWidget
  • Charcoal\Admin\Widget\Cms\SectionTableWidget
  • Charcoal\Cms\AbstractDocument
  • Charcoal\Cms\AbstractEvent
  • Charcoal\Cms\AbstractFaq
  • Charcoal\Cms\AbstractImage
  • Charcoal\Cms\AbstractNews
  • Charcoal\Cms\AbstractSection
  • Charcoal\Cms\AbstractText
  • Charcoal\Cms\AbstractVideo
  • Charcoal\Cms\Config
  • Charcoal\Cms\Config\CmsConfig
  • Charcoal\Cms\Config\EventConfig
  • Charcoal\Cms\Config\NewsConfig
  • Charcoal\Cms\Config\SectionConfig
  • Charcoal\Cms\Document
  • Charcoal\Cms\DocumentCategory
  • Charcoal\Cms\EmptySection
  • Charcoal\Cms\Event
  • Charcoal\Cms\EventCategory
  • Charcoal\Cms\ExternalSection
  • Charcoal\Cms\Faq
  • Charcoal\Cms\FaqCategory
  • Charcoal\Cms\Image
  • Charcoal\Cms\ImageCategory
  • Charcoal\Cms\News
  • Charcoal\Cms\NewsCategory
  • Charcoal\Cms\Route\EventRoute
  • Charcoal\Cms\Route\GenericRoute
  • Charcoal\Cms\Route\NewsRoute
  • Charcoal\Cms\Route\SectionRoute
  • Charcoal\Cms\Section
  • Charcoal\Cms\Section\BlocksSection
  • Charcoal\Cms\Section\ContentSection
  • Charcoal\Cms\Service\Loader\AbstractLoader
  • Charcoal\Cms\Service\Loader\EventLoader
  • Charcoal\Cms\Service\Loader\NewsLoader
  • Charcoal\Cms\Service\Loader\SectionLoader
  • Charcoal\Cms\Service\Manager\AbstractManager
  • Charcoal\Cms\Service\Manager\EventManager
  • Charcoal\Cms\Service\Manager\NewsManager
  • Charcoal\Cms\ServiceProvider\CmsServiceProvider
  • Charcoal\Cms\Support\Helpers\DateHelper
  • Charcoal\Cms\Tag
  • Charcoal\Cms\Text
  • Charcoal\Cms\TextCategory
  • Charcoal\Cms\Video
  • Charcoal\Cms\VideoCategory
  • Charcoal\Property\TemplateOptionsProperty
  • Charcoal\Property\TemplateProperty

Interfaces

  • Charcoal\Cms\DocumentInterface
  • Charcoal\Cms\EventInterface
  • Charcoal\Cms\FaqInterface
  • Charcoal\Cms\ImageInterface
  • Charcoal\Cms\MetatagInterface
  • Charcoal\Cms\Mixin\HasContentBlocksInterface
  • Charcoal\Cms\NewsInterface
  • Charcoal\Cms\SearchableInterface
  • Charcoal\Cms\SectionInterface
  • Charcoal\Cms\Support\Interfaces\EventManagerAwareInterface
  • Charcoal\Cms\Support\Interfaces\NewsManagerAwareInterface
  • Charcoal\Cms\Support\Interfaces\SectionLoaderAwareInterface
  • Charcoal\Cms\TemplateableInterface
  • Charcoal\Cms\TextInterface
  • Charcoal\Cms\VideoInterface

Traits

  • Charcoal\Admin\Widget\Cms\SectionTableTrait
  • Charcoal\Cms\MetatagTrait
  • Charcoal\Cms\Mixin\Traits\HasContentBlocksTrait
  • Charcoal\Cms\SearchableTrait
  • Charcoal\Cms\Support\Traits\DateHelperAwareTrait
  • Charcoal\Cms\Support\Traits\EventManagerAwareTrait
  • Charcoal\Cms\Support\Traits\NewsManagerAwareTrait
  • Charcoal\Cms\Support\Traits\SectionLoaderAwareTrait
  • Charcoal\Cms\TemplateableTrait
  • Overview
  • Namespace
  • Class
  1: <?php
  2: 
  3: namespace Charcoal\Cms;
  4: 
  5: use Exception;
  6: 
  7: // From 'charcoal-translator'
  8: use Charcoal\Translator\Translation;
  9: 
 10: // From 'charcoal-cms'
 11: use Charcoal\Object\CategoryInterface;
 12: use Charcoal\Object\CategoryTrait;
 13: use Charcoal\Object\Content;
 14: 
 15: /**
 16:  * CMS Tag
 17:  */
 18: class Tag extends Content implements
 19:     CategoryInterface
 20: {
 21:     use CategoryTrait;
 22: 
 23:     /**
 24:      * The tag's name.
 25:      *
 26:      * @var Translation|string|null
 27:      */
 28:     protected $name;
 29: 
 30:     /**
 31:      * The tag's color.
 32:      *
 33:      * @var string
 34:      */
 35:     protected $color;
 36: 
 37:     /**
 38:      * @param array $data The object's data options.
 39:      */
 40:     public function __construct(array $data = null)
 41:     {
 42:         parent::__construct($data);
 43: 
 44:         $this->setData($this->defaultData());
 45:     }
 46: 
 47:     // ==========================================================================
 48:     // Functions
 49:     // ==========================================================================
 50: 
 51:     /**
 52:      * @throws Exception If function is called.
 53:      * @return void
 54:      */
 55:     public function loadCategoryItems()
 56:     {
 57:         throw new Exception('Cannot use loadCategoryItems');
 58:     }
 59: 
 60:     // ==========================================================================
 61:     // GETTERS
 62:     // ==========================================================================
 63: 
 64:     /**
 65:      * The tag's name.
 66:      *
 67:      * @return Translation|string|null
 68:      */
 69:     public function name()
 70:     {
 71:         return $this->name;
 72:     }
 73: 
 74:     /**
 75:      * The tag's color.
 76:      *
 77:      * @return mixed
 78:      */
 79:     public function color()
 80:     {
 81:         return $this->color;
 82:     }
 83: 
 84:     // ==========================================================================
 85:     // SETTERS
 86:     // ==========================================================================
 87: 
 88:     /**
 89:      * @param  mixed $name The name of the tag.
 90:      * @return self
 91:      */
 92:     public function setName($name)
 93:     {
 94:         $this->name = $this->translator()->translation($name);
 95:         return $this;
 96:     }
 97: 
 98:     /**
 99:      * @param  string $color The color in HEX format as a string.
100:      * @return self
101:      */
102:     public function setColor($color)
103:     {
104:         $this->color = $color;
105:         return $this;
106:     }
107: }
108: 
API documentation generated by ApiGen