code: private function _setCriteriaIdByType ($criteria, Element $type, $id)
  	{
  		switch ($type::className()) {
  			case 'Entry':
  				$criteria->sectionId = $id;
  				break;
  			case 'Category':
  				$criteria->groupId = $id;
  				break;
  		}
  	}
docs: Sets the section or group ID on the criteria according to the
  given element type
  
  @param EntryQuery|CategoryQuery $criteria - The criteria
  @param Element                  $type - The element type
  @param int                      $id - The section or group ID