protected function checkType($item) { $type = $this->getItemType($item); if (!$this->type) { $this->type = $type; return true; } if ($this->type != $type) { return false; } return true; }