/** * Filter the query by a related Artista object * * @param Artista|PropelCollection $artista 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 */ public function filterByArtista($artista, $comparison = null) { if ($artista instanceof Artista) { return $this->addUsingAlias(ProductoPeer::IDARTISTA, $artista->getIdartista(), $comparison); } elseif ($artista instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(ProductoPeer::IDARTISTA, $artista->toKeyValue('PrimaryKey', 'Idartista'), $comparison); } else { throw new PropelException('filterByArtista() only accepts arguments of type Artista or PropelCollection'); } }
/** * Exclude object from result * * @param Artista $artista Object to remove from the list of results * * @return ArtistaQuery The current query, for fluid interface */ public function prune($artista = null) { if ($artista) { $this->addUsingAlias(ArtistaPeer::IDARTISTA, $artista->getIdartista(), Criteria::NOT_EQUAL); } return $this; }
/** * Declares an association between this object and a Artista object. * * @param Artista $v * @return Producto The current object (for fluent API support) * @throws PropelException */ public function setArtista(Artista $v = null) { if ($v === null) { $this->setIdartista(NULL); } else { $this->setIdartista($v->getIdartista()); } $this->aArtista = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Artista object, it will not be re-added. if ($v !== null) { $v->addProducto($this); } return $this; }