/** * Filter the query by a related Consultorio object * * @param Consultorio|PropelObjectCollection $consultorio The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ConsultaQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByConsultorio($consultorio, $comparison = null) { if ($consultorio instanceof Consultorio) { return $this->addUsingAlias(ConsultaPeer::IDCONSULTORIO, $consultorio->getIdconsultorio(), $comparison); } elseif ($consultorio instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ConsultaPeer::IDCONSULTORIO, $consultorio->toKeyValue('PrimaryKey', 'Idconsultorio'), $comparison); } else { throw new PropelException('filterByConsultorio() only accepts arguments of type Consultorio or PropelCollection'); } }
/** * Filter the query by a related Consulta object * * @param Consulta|PropelObjectCollection $consulta the related object to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return ConsultorioQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByConsulta($consulta, $comparison = null) { if ($consulta instanceof Consulta) { return $this->addUsingAlias(ConsultorioPeer::IDCONSULTORIO, $consulta->getIdconsultorio(), $comparison); } elseif ($consulta instanceof PropelObjectCollection) { return $this->useConsultaQuery()->filterByPrimaryKeys($consulta->getPrimaryKeys())->endUse(); } else { throw new PropelException('filterByConsulta() only accepts arguments of type Consulta or PropelCollection'); } }