/** * 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 void */ public function setByPosition($pos, $value) { switch ($pos) { case 0: $this->setId($value); break; case 1: $this->setSystemEventId($value); break; case 2: $this->setUserId($value); break; case 3: $valueSet = SystemEventSubscriptionPeer::getValueSet(SystemEventSubscriptionPeer::TYPE); if (isset($valueSet[$value])) { $value = $valueSet[$value]; } $this->setType($value); break; case 4: $this->setRemoteUrl($value); break; case 5: $this->setSubject($value); break; case 6: $this->setTemplate($value); break; case 7: $this->setAuthorizationToken($value); break; case 8: $this->setEnabled($value); break; case 9: $this->setCreatedAt($value); break; case 10: $this->setUpdatedAt($value); break; } // switch() }
/** * Filter the query on the type column * * @param mixed $type The value to use as filter * @param string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL * * @return SystemEventSubscriptionQuery The current query, for fluid interface * @throws PropelException - if the value is not accepted by the enum. */ public function filterByType($type = null, $comparison = null) { $valueSet = SystemEventSubscriptionPeer::getValueSet(SystemEventSubscriptionPeer::TYPE); if (is_scalar($type)) { if (!in_array($type, $valueSet)) { throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $type)); } $type = array_search($type, $valueSet); } elseif (is_array($type)) { $convertedValues = array(); foreach ($type 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); } $type = $convertedValues; if (null === $comparison) { $comparison = Criteria::IN; } } return $this->addUsingAlias(SystemEventSubscriptionPeer::TYPE, $type, $comparison); }