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