/** * Filter the query on the medal column * * @param mixed $medal The value to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return $this|ChildBetQuery The current query, for fluid interface */ public function filterByMedal($medal = null, $comparison = null) { $valueSet = BetTableMap::getValueSet(BetTableMap::COL_MEDAL); if (is_scalar($medal)) { if (!in_array($medal, $valueSet)) { throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $medal)); } $medal = array_search($medal, $valueSet); } elseif (is_array($medal)) { $convertedValues = array(); foreach ($medal as $value) { if (!in_array($value, $valueSet)) { throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $value)); } $convertedValues[] = array_search($value, $valueSet); } $medal = $convertedValues; if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(BetTableMap::COL_MEDAL, $medal, $comparison); }
/** * Sets a field from the object by Position as specified in the xml schema. * Zero-based. * * @param int $pos position in xml schema * @param mixed $value field value * @return $this|\ApostaAiApi\Models\Bet */ public function setByPosition($pos, $value) { switch ($pos) { case 0: $this->setUserId($value); break; case 1: $this->setChosenParticipantId($value); break; case 2: $this->setChosenResult($value); break; case 3: $valueSet = BetTableMap::getValueSet(BetTableMap::COL_MEDAL); if (isset($valueSet[$value])) { $value = $valueSet[$value]; } $this->setMedal($value); break; } // switch() return $this; }