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