示例#1
0
 /**
  * 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->setUserId($value);
             break;
         case 2:
             $this->setName($value);
             break;
         case 3:
             $this->setNameSlug($value);
             break;
         case 4:
             $this->setDescription($value);
             break;
         case 5:
             $this->setExcerpt($value);
             break;
         case 6:
             $this->setGovermentLicense($value);
             break;
         case 7:
             $this->setJoinAt($value);
             break;
         case 8:
             $this->setAddress1($value);
             break;
         case 9:
             $this->setAddress2($value);
             break;
         case 10:
             $this->setCity($value);
             break;
         case 11:
             $this->setZipcode($value);
             break;
         case 12:
             $this->setCountryId($value);
             break;
         case 13:
             $this->setStateId($value);
             break;
         case 14:
             $this->setPhone($value);
             break;
         case 15:
             $this->setFax($value);
             break;
         case 16:
             $this->setMobile($value);
             break;
         case 17:
             $this->setEmail($value);
             break;
         case 18:
             $this->setWebsite($value);
             break;
         case 19:
             $this->setLogo($value);
             break;
         case 20:
             $valueSet = PrincipalArchivePeer::getValueSet(PrincipalArchivePeer::STATUS);
             if (isset($valueSet[$value])) {
                 $value = $valueSet[$value];
             }
             $this->setStatus($value);
             break;
         case 21:
             $this->setIsPrincipal($value);
             break;
         case 22:
             $valueSet = PrincipalArchivePeer::getValueSet(PrincipalArchivePeer::CONFIRMATION);
             if (isset($valueSet[$value])) {
                 $value = $valueSet[$value];
             }
             $this->setConfirmation($value);
             break;
         case 23:
             $this->setSortableRank($value);
             break;
         case 24:
             $this->setCreatedAt($value);
             break;
         case 25:
             $this->setUpdatedAt($value);
             break;
         case 26:
             $this->setArchivedAt($value);
             break;
     }
     // switch()
 }
 /**
  * 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 = PrincipalArchivePeer::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);
 }