public function getItems($withInheritedValues = false)
{
if ($withInheritedValues) {
$getters = $this->getBrickGetters();
$values = [];
foreach ($getters as $getter) {
$value = $this->{$getter}();
if (!empty($value)) {
$values[] = $value;
}
}
return $values;
} else {
if (empty($this->items)) {
foreach (get_object_vars($this) as $var) {
if ($var instanceof Objectbrick\Data\AbstractData) {
$this->items[] = $var;
}
}
}
return $this->items;
}
}