/** * 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->setEmployeeId($value); break; case 2: $this->setStoreId($value); break; case 3: $this->setRemark($value); break; case 4: $valueSet = VisitationPeer::getValueSet(VisitationPeer::STATUS); if (isset($valueSet[$value])) { $value = $valueSet[$value]; } $this->setStatus($value); break; case 5: $this->setTotal($value); break; case 6: $this->setPhoto($value); break; case 7: $this->setCreatedAt($value); break; case 8: $this->setUpdatedAt($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 = VisitationPeer::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); }