示例#1
0
 /**
  * Filter the query by a related \Tekstove\ApiBundle\Model\Lyric object
  *
  * @param \Tekstove\ApiBundle\Model\Lyric|ObjectCollection $lyric The related object(s) to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @throws \Propel\Runtime\Exception\PropelException
  *
  * @return ChildLyricVoteQuery The current query, for fluid interface
  */
 public function filterByLyric($lyric, $comparison = null)
 {
     if ($lyric instanceof \Tekstove\ApiBundle\Model\Lyric) {
         return $this->addUsingAlias(LyricVoteTableMap::COL_LYRIC_ID, $lyric->getId(), $comparison);
     } elseif ($lyric instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(LyricVoteTableMap::COL_LYRIC_ID, $lyric->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByLyric() only accepts arguments of type \\Tekstove\\ApiBundle\\Model\\Lyric or Collection');
     }
 }