3 namespace Sabberworm\CSS\Property
;
6 * CSSNamespace represents an @namespace rule.
8 class CSSNamespace
implements AtRule
{
14 public function __construct($mUrl, $sPrefix = null, $iLineNo = 0) {
16 $this->sPrefix
= $sPrefix;
17 $this->iLineNo
= $iLineNo;
18 $this->aComments
= array();
24 public function getLineNo() {
25 return $this->iLineNo
;
28 public function __toString() {
29 return $this->render(new \Sabberworm\CSS\
OutputFormat());
32 public function render(\Sabberworm\CSS\OutputFormat
$oOutputFormat) {
33 return '@namespace '.($this->sPrefix
=== null ?
'' : $this->sPrefix
.' ').$this->mUrl
->render($oOutputFormat).';';
36 public function getUrl() {
40 public function getPrefix() {
41 return $this->sPrefix
;
44 public function setUrl($mUrl) {
48 public function setPrefix($sPrefix) {
49 $this->sPrefix
= $sPrefix;
52 public function atRuleName() {
56 public function atRuleArgs() {
57 $aResult = array($this->mUrl
);
59 array_unshift($aResult, $this->sPrefix
);
64 public function addComments(array $aComments) {
65 $this->aComments
= array_merge($this->aComments
, $aComments);
68 public function getComments() {
69 return $this->aComments
;
72 public function setComments(array $aComments) {
73 $this->aComments
= $aComments;