/** * Filter the query by a related Especialidad object * * @param Especialidad|PropelObjectCollection $especialidad The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return AgendaQuery The current query, for fluid interface * @throws PropelException - if the provided filter is invalid. */ public function filterByEspecialidad($especialidad, $comparison = null) { if ($especialidad instanceof Especialidad) { return $this->addUsingAlias(AgendaPeer::SERVICIO, $especialidad->getId(), $comparison); } elseif ($especialidad instanceof PropelObjectCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(AgendaPeer::SERVICIO, $especialidad->toKeyValue('PrimaryKey', 'Id'), $comparison); } else { throw new PropelException('filterByEspecialidad() only accepts arguments of type Especialidad or PropelCollection'); } }