/** * 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['GroupPerson'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['GroupPerson'][$this->hashCode()] = true; $keys = GroupPersonTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getGroupid(), $keys[2] => $this->getGrouppersontypeid(), $keys[3] => $this->getGroupevepersonid(), $keys[4] => $this->getUserid()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aGroup) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'group'; break; case TableMap::TYPE_FIELDNAME: $key = 'gr0up'; break; default: $key = 'Group'; } $result[$key] = $this->aGroup->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aGroupPersonType) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'groupPersonType'; break; case TableMap::TYPE_FIELDNAME: $key = 'grouppersontype'; break; default: $key = 'GroupPersonType'; } $result[$key] = $this->aGroupPersonType->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aGroupEvePerson) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'groupEvePerson'; break; case TableMap::TYPE_FIELDNAME: $key = 'groupeveperson'; break; default: $key = 'GroupEvePerson'; } $result[$key] = $this->aGroupEvePerson->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); } } 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['EveApi'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['EveApi'][$this->hashCode()] = true; $keys = EveApiTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getUserid(), $keys[2] => $this->getKeyid(), $keys[3] => $this->getVcode(), $keys[4] => $this->getStatus(), $keys[5] => $this->getLastcomputed()); $utc = new \DateTimeZone('utc'); if ($result[$keys[5]] instanceof \DateTime) { // When changing timezone we don't want to change existing instances $dateTime = clone $result[$keys[5]]; $result[$keys[5]] = $dateTime->setTimezone($utc)->format('Y-m-d\\TH:i:s\\Z'); } $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { 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->collEveCharacters) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'eveCharacters'; break; case TableMap::TYPE_FIELDNAME: $key = 'evecharacters'; break; default: $key = 'EveCharacters'; } $result[$key] = $this->collEveCharacters->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } } 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['CompositionEntity'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['CompositionEntity'][$this->hashCode()] = true; $keys = CompositionEntityTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getName(), $keys[2] => $this->getUserid(), $keys[3] => $this->getIslisted(), $keys[4] => $this->getForkedid(), $keys[5] => $this->getRulesetentityid(), $keys[6] => $this->getLastmodified()); $utc = new \DateTimeZone('utc'); if ($result[$keys[6]] instanceof \DateTime) { // When changing timezone we don't want to change existing instances $dateTime = clone $result[$keys[6]]; $result[$keys[6]] = $dateTime->setTimezone($utc)->format('Y-m-d\\TH:i:s\\Z'); } $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { 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->aCompositionEntityRelatedByForkedid) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'compositionEntity'; break; case TableMap::TYPE_FIELDNAME: $key = 'compositionentity'; break; default: $key = 'CompositionEntity'; } $result[$key] = $this->aCompositionEntityRelatedByForkedid->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aRulesetEntity) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'rulesetEntity'; break; case TableMap::TYPE_FIELDNAME: $key = 'rulesetentity'; break; default: $key = 'RulesetEntity'; } $result[$key] = $this->aRulesetEntity->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collCompositionEntitiesRelatedById) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'compositionEntities'; break; case TableMap::TYPE_FIELDNAME: $key = 'compositionentities'; break; default: $key = 'CompositionEntities'; } $result[$key] = $this->collCompositionEntitiesRelatedById->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collCompositionRows) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'compositionRows'; break; case TableMap::TYPE_FIELDNAME: $key = 'compositionrows'; break; default: $key = 'CompositionRows'; } $result[$key] = $this->collCompositionRows->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } } return $result; }