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