示例#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->setLogin($value);
             break;
         case 2:
             $this->setPrenom($value);
             break;
         case 3:
             $this->setNom($value);
             break;
         case 4:
             $this->setMail($value);
             break;
         case 5:
             $valueSet = PersonnePeer::getValueSet(PersonnePeer::TYPE);
             if (isset($valueSet[$value])) {
                 $value = $valueSet[$value];
             }
             $this->setType($value);
             break;
         case 6:
             $this->setDateNaissance($value);
             break;
         case 7:
             $this->setIsAdulte($value);
             break;
         case 8:
             $this->setBadgeUid($value);
             break;
         case 9:
             $this->setExpirationBadge($value);
             break;
         case 10:
             $this->setCreatedAt($value);
             break;
         case 11:
             $this->setUpdatedAt($value);
             break;
     }
     // switch()
 }
示例#2
0
 /**
  * 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 PersonneQuery 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 = PersonnePeer::getValueSet(PersonnePeer::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(PersonnePeer::TYPE, $type, $comparison);
 }