/**
  * @param null $model
  *
  * @return mixed
  */
 private function buildQuery($model = null)
 {
     $query = $this->model->collections();
     $query = $query->whereCollectionName($this->collectionName);
     if ($model) {
         $query = $query->where('item_id', $model->id)->where('item_type', get_class($model));
     }
     if (!$model && $this->itemType) {
         $query = $query->where('item_type', '=', $this->itemType);
     }
     return $query;
 }