/** * @param BaseModel $model * @return mixed|string */ protected function getItemKey(BaseModel $model) { if ($model->exists) { return $model->getKey(); } return $this->getItemHash($model); }