Exemplo n.º 1
0
 /**
  * Filter the query by a related Tipo object
  *
  * @param   Tipo|PropelObjectCollection $tipo The related object(s) to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 ArticuloQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByTipo($tipo, $comparison = null)
 {
     if ($tipo instanceof Tipo) {
         return $this->addUsingAlias(ArticuloPeer::IDTIPO, $tipo->getIdtipo(), $comparison);
     } elseif ($tipo instanceof PropelObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(ArticuloPeer::IDTIPO, $tipo->toKeyValue('PrimaryKey', 'Idtipo'), $comparison);
     } else {
         throw new PropelException('filterByTipo() only accepts arguments of type Tipo or PropelCollection');
     }
 }
Exemplo n.º 2
0
 /**
  * Filter the query by a related Articulo object
  *
  * @param   Articulo|PropelObjectCollection $articulo  the related object to use as filter
  * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return                 TipoQuery The current query, for fluid interface
  * @throws PropelException - if the provided filter is invalid.
  */
 public function filterByArticulo($articulo, $comparison = null)
 {
     if ($articulo instanceof Articulo) {
         return $this->addUsingAlias(TipoPeer::IDTIPO, $articulo->getIdtipo(), $comparison);
     } elseif ($articulo instanceof PropelObjectCollection) {
         return $this->useArticuloQuery()->filterByPrimaryKeys($articulo->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByArticulo() only accepts arguments of type Articulo or PropelCollection');
     }
 }