protected function getPresentCount($attributes) { $count = 0; foreach ($attributes as $key) { if (array_get($this->data, $key) || array_get($this->files, $key)) { ++$count; } } return $count; }