/** * Gets the SQL value for the ENUM column value * * @param string $colname ENUM column name. * @param string $enumVal ENUM value. * * @return int SQL value */ public static function getSqlValueForEnum($colname, $enumVal) { $values = UserOrganizationPeer::getValueSet($colname); if (!in_array($enumVal, $values)) { throw new PropelException(sprintf('Value "%s" is not accepted in this enumerated column', $colname)); } return array_search($enumVal, $values); }
/** * 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->setUserId($value); break; case 1: $this->setOrganizationId($value); break; case 2: $valueSet = UserOrganizationPeer::getValueSet(UserOrganizationPeer::ORGANIZATION_ROLE); if (isset($valueSet[$value])) { $value = $valueSet[$value]; } $this->setOrganizationRole($value); break; } // switch() }