protected function setProperties($type = null, $key = null, $attributes = [], $validKeys = [])
{
if (isset($this->properties['type']) && $this->properties['type'] == $type) {
foreach ($attributes as $attribute => $value) {
if (in_array($attribute, $validKeys)) {
$this->{$key}[$attribute] = $value;
}
}
}
}