public function getTagValues($asArray = null)
{
if (!$this->owner->getIsNewRecord() && $this->_tagValues === null) {
$this->_tagValues = [];
/* @var ActiveRecord $tag */
foreach ($this->owner->{$this->tagRelation} as $tag) {
$this->_tagValues[] = $tag->getAttribute($this->tagValueAttribute);
}
}
if ($asArray === null) {
$asArray = $this->tagValuesAsArray;
}
if ($asArray) {
return $this->_tagValues === null ? [] : $this->_tagValues;
} else {
return $this->_tagValues === null ? '' : implode(', ', $this->_tagValues);
}
}