/** * Declares an association between this object and a Provincia object. * * @param Provincia $v * @return Ciudad The current object (for fluent API support) * @throws PropelException */ public function setProvincia(Provincia $v = null) { if ($v === null) { $this->setIdProvincia(NULL); } else { $this->setIdProvincia($v->getIdprovincia()); } $this->aProvincia = $v; // Add binding for other direction of this n:n relationship. // If this object has already been added to the Provincia object, it will not be re-added. if ($v !== null) { $v->addCiudad($this); } return $this; }
/** * Exclude object from result * * @param Provincia $provincia Object to remove from the list of results * * @return ProvinciaQuery The current query, for fluid interface */ public function prune($provincia = null) { if ($provincia) { $this->addUsingAlias(ProvinciaPeer::IDPROVINCIA, $provincia->getIdprovincia(), Criteria::NOT_EQUAL); } return $this; }
/** * Filter the query by a related Provincia object * * @param Provincia|PropelCollection $provincia The related object(s) to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return CiudadQuery The current query, for fluid interface */ public function filterByProvincia($provincia, $comparison = null) { if ($provincia instanceof Provincia) { return $this->addUsingAlias(CiudadPeer::ID_PROVINCIA, $provincia->getIdprovincia(), $comparison); } elseif ($provincia instanceof PropelCollection) { if (null === $comparison) { $comparison = Criteria::IN; } return $this->addUsingAlias(CiudadPeer::ID_PROVINCIA, $provincia->toKeyValue('PrimaryKey', 'Idprovincia'), $comparison); } else { throw new PropelException('filterByProvincia() only accepts arguments of type Provincia or PropelCollection'); } }