/**
  * Exports the object as an array.
  *
  * You can specify the key type of the array by passing one of the class
  * type constants.
  *
  * @param     string  $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME,
  *                    TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
  *                    Defaults to TableMap::TYPE_PHPNAME.
  * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
  * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
  *
  * @return array an associative array containing the field names (as keys) and field values
  */
 public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
 {
     if (isset($alreadyDumpedObjects['InputError'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['InputError'][$this->hashCode()] = true;
     $keys = InputErrorTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getId(), $keys[1] => $this->getInputUuid(), $keys[2] => $this->getBerAverage(), $keys[3] => $this->getUncAverage(), $keys[4] => $this->getCumulativeTe(), $keys[5] => $this->getCumulativeCc(), $keys[6] => $this->getCreated(), $keys[7] => $this->getModified());
     if ($result[$keys[6]] instanceof \DateTime) {
         $result[$keys[6]] = $result[$keys[6]]->format('c');
     }
     if ($result[$keys[7]] instanceof \DateTime) {
         $result[$keys[7]] = $result[$keys[7]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aInput) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'input';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'input';
                     break;
                 default:
                     $key = 'Input';
             }
             $result[$key] = $this->aInput->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
     }
     return $result;
 }
 /**
  * Exports the object as an array.
  *
  * You can specify the key type of the array by passing one of the class
  * type constants.
  *
  * @param     string  $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_CAMELNAME,
  *                    TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
  *                    Defaults to TableMap::TYPE_PHPNAME.
  * @param     boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns. Defaults to TRUE.
  * @param     array $alreadyDumpedObjects List of objects to skip to avoid recursion
  * @param     boolean $includeForeignObjects (optional) Whether to include hydrated related objects. Default to FALSE.
  *
  * @return array an associative array containing the field names (as keys) and field values
  */
 public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
 {
     if (isset($alreadyDumpedObjects['Subscription'][$this->hashCode()])) {
         return '*RECURSION*';
     }
     $alreadyDumpedObjects['Subscription'][$this->hashCode()] = true;
     $keys = SubscriptionTableMap::getFieldNames($keyType);
     $result = array($keys[0] => $this->getId(), $keys[1] => $this->getInstanceName(), $keys[2] => $this->getInputUuid(), $keys[3] => $this->getUserId(), $keys[4] => $this->getChannelId(), $keys[5] => $this->getSubscriptionId(), $keys[6] => $this->getStarted(), $keys[7] => $this->getStopped(), $keys[8] => $this->getTitle(), $keys[9] => $this->getService());
     if ($result[$keys[6]] instanceof \DateTime) {
         $result[$keys[6]] = $result[$keys[6]]->format('c');
     }
     if ($result[$keys[7]] instanceof \DateTime) {
         $result[$keys[7]] = $result[$keys[7]]->format('c');
     }
     $virtualColumns = $this->virtualColumns;
     foreach ($virtualColumns as $key => $virtualColumn) {
         $result[$key] = $virtualColumn;
     }
     if ($includeForeignObjects) {
         if (null !== $this->aInstance) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'instance';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'instance';
                     break;
                 default:
                     $key = 'Instance';
             }
             $result[$key] = $this->aInstance->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aInput) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'input';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'input';
                     break;
                 default:
                     $key = 'Input';
             }
             $result[$key] = $this->aInput->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aUser) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'user';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'user';
                     break;
                 default:
                     $key = 'User';
             }
             $result[$key] = $this->aUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
         if (null !== $this->aChannel) {
             switch ($keyType) {
                 case TableMap::TYPE_CAMELNAME:
                     $key = 'channel';
                     break;
                 case TableMap::TYPE_FIELDNAME:
                     $key = 'channel';
                     break;
                 default:
                     $key = 'Channel';
             }
             $result[$key] = $this->aChannel->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
         }
     }
     return $result;
 }