Esempio n. 1
0
 /**
  * Filter the query by a related \ApostaAiApi\Models\Participant object
  *
  * @param \ApostaAiApi\Models\Participant|ObjectCollection $participant 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 ChildBetQuery The current query, for fluid interface
  */
 public function filterByParticipant($participant, $comparison = null)
 {
     if ($participant instanceof \ApostaAiApi\Models\Participant) {
         return $this->addUsingAlias(BetTableMap::COL_CHOSEN_PARTICIPANT_ID, $participant->getId(), $comparison);
     } elseif ($participant instanceof ObjectCollection) {
         if (null === $comparison) {
             $comparison = Criteria::IN;
         }
         return $this->addUsingAlias(BetTableMap::COL_CHOSEN_PARTICIPANT_ID, $participant->toKeyValue('PrimaryKey', 'Id'), $comparison);
     } else {
         throw new PropelException('filterByParticipant() only accepts arguments of type \\ApostaAiApi\\Models\\Participant or Collection');
     }
 }
 /**
  * Exclude object from result
  *
  * @param   ChildParticipant $participant Object to remove from the list of results
  *
  * @return $this|ChildParticipantQuery The current query, for fluid interface
  */
 public function prune($participant = null)
 {
     if ($participant) {
         $this->addUsingAlias(ParticipantTableMap::COL_ID, $participant->getId(), Criteria::NOT_EQUAL);
     }
     return $this;
 }
Esempio n. 3
0
 /**
  * Clears the current object, sets all attributes to their default values and removes
  * outgoing references as well as back-references (from other objects to this one. Results probably in a database
  * change of those foreign objects when you call `save` there).
  */
 public function clear()
 {
     if (null !== $this->aUser) {
         $this->aUser->removeBet($this);
     }
     if (null !== $this->aParticipant) {
         $this->aParticipant->removeBet($this);
     }
     $this->user_id = null;
     $this->chosen_participant_id = null;
     $this->chosen_result = null;
     $this->medal = null;
     $this->alreadyInSave = false;
     $this->clearAllReferences();
     $this->resetModified();
     $this->setNew(true);
     $this->setDeleted(false);
 }
Esempio n. 4
0
 /**
  * @param ChildParticipant $participant The ChildParticipant object to add.
  */
 protected function doAddParticipant(ChildParticipant $participant)
 {
     $this->collParticipants[] = $participant;
     $participant->setGame($this);
 }
Esempio n. 5
0
 /**
  * Filter the query by a related \ApostaAiApi\Models\Participant object
  *
  * @param \ApostaAiApi\Models\Participant|ObjectCollection $participant the related object to use as filter
  * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
  *
  * @return ChildGameQuery The current query, for fluid interface
  */
 public function filterByParticipant($participant, $comparison = null)
 {
     if ($participant instanceof \ApostaAiApi\Models\Participant) {
         return $this->addUsingAlias(GameTableMap::COL_ID, $participant->getGameId(), $comparison);
     } elseif ($participant instanceof ObjectCollection) {
         return $this->useParticipantQuery()->filterByPrimaryKeys($participant->getPrimaryKeys())->endUse();
     } else {
         throw new PropelException('filterByParticipant() only accepts arguments of type \\ApostaAiApi\\Models\\Participant or Collection');
     }
 }