/**
  * Filter the query by a related Medico object
  *
  * @param   Medico|PropelObjectCollection $medico  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 EspecialidadQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByMedico($medico, $comparison = null)
 {
     if ($medico instanceof Medico) {
         return $this->addUsingAlias(EspecialidadPeer::IDESPECIALIDAD, $medico->getIdespecialidad(), $comparison);
     } elseif ($medico instanceof PropelObjectCollection) {
         return $this->useMedicoQuery()->filterByPrimaryKeys($medico->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByMedico() only accepts arguments of type Medico or PropelCollection');
     }
 }