/** * Filter the query by a related Producto object * * @param Producto|PropelCollection $producto The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return VentaQuery The current query, for fluid interface */ public function filterByProducto($producto, $comparison = null) { if ($producto instanceof Producto) { return $this->addUsingAlias(VentaPeer::IDPRODUCTO, $producto->getIdproducto(), $comparison); } elseif ($producto instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(VentaPeer::IDPRODUCTO, $producto->toKeyValue('PrimaryKey', 'Idproducto'), $comparison); } else { throw new PropelException('filterByProducto() only accepts arguments of type Producto or PropelCollection'); } }