ILIAS  release_8 Revision v8.24
class.ilSystemStyleLessCategory.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
29{
33 protected string $name = '';
34
38 protected string $comment = '';
39
40 public function __construct(string $name, string $comment = '')
41 {
42 $this->setName($name);
43 $this->setComment($comment);
44 }
45
46 public function getName(): string
47 {
48 return $this->name;
49 }
50
51 public function setName(string $name): void
52 {
53 $name = str_replace(PHP_EOL, '', $name);
54 $this->name = str_replace("\n", '', $name);
55 }
56
57 public function getComment(): string
58 {
59 return $this->comment;
60 }
61
62 public function setComment(string $comment): void
63 {
64 $comment = str_replace(PHP_EOL, '', $comment);
65 $this->comment = str_replace("\n", '', $comment);
66 }
67
72 public function __toString(): string
73 {
74 if ($this->getComment()) {
75 return '//== ' . $this->getName() . "\n//\n//## " . $this->getComment() . "\n";
76 } else {
77 return '//== ' . $this->getName() . "\n//\n//##\n";
78 }
79 }
80}
Capsules data of a less category in the variables to less file.
string $comment
Comment to describe what this category is about.
__construct(string $name, string $comment='')
__toString()
This function will be needed to write the category back to the less file and restore it's initial str...
Abstracts content of a less file.