<?php
namespace Moto\System; class BagValue { protected $_value; protected $_glue; public function __construct($value = '', $glue = "\n") { $this->setValue($value); $this->setGlue($glue); } public function setValue($value) { $this->_value = $value; return $this; } public function getValue() { return $this->_value; } public function setGlue($glue) { $this->_glue = $glue; return $this; } public function getGlue() { return $this->_glue; } public function __toString() { $value = $this->getValue(); if (is_array($value)) { $value = implode((string) $this->getGlue(), $value); } $value = (string) $value; return $value; } } 