/** * 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['Round'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Round'][$this->hashCode()] = true; $keys = RoundTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getNr(), $keys[2] => $this->getPublished(), $keys[3] => $this->getCompleted(), $keys[4] => $this->getChampionshipId(), $keys[5] => $this->getMatchCount()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aChampionship) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'championship'; break; case TableMap::TYPE_FIELDNAME: $key = 'championships'; break; default: $key = 'Championship'; } $result[$key] = $this->aChampionship->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collMatches) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'matches'; break; case TableMap::TYPE_FIELDNAME: $key = 'matchess'; break; default: $key = 'Matches'; } $result[$key] = $this->collMatches->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['Match'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Match'][$this->hashCode()] = true; $keys = MatchTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getNr(), $keys[2] => $this->getDate(), $keys[3] => $this->getResult(), $keys[4] => $this->getToto(), $keys[5] => $this->getChampionshipId(), $keys[6] => $this->getRoundId(), $keys[7] => $this->getLeagueId(), $keys[8] => $this->getHometeamId(), $keys[9] => $this->getAwayteamId()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aChampionship) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'championship'; break; case TableMap::TYPE_FIELDNAME: $key = 'championships'; break; default: $key = 'Championship'; } $result[$key] = $this->aChampionship->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aRound) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'round'; break; case TableMap::TYPE_FIELDNAME: $key = 'rounds'; break; default: $key = 'Round'; } $result[$key] = $this->aRound->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aLeague) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'league'; break; case TableMap::TYPE_FIELDNAME: $key = 'leagues'; break; default: $key = 'League'; } $result[$key] = $this->aLeague->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aHometeam) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'team'; break; case TableMap::TYPE_FIELDNAME: $key = 'teams'; break; default: $key = 'Team'; } $result[$key] = $this->aHometeam->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aAwayteam) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'team'; break; case TableMap::TYPE_FIELDNAME: $key = 'teams'; break; default: $key = 'Team'; } $result[$key] = $this->aAwayteam->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collTips) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'tips'; break; case TableMap::TYPE_FIELDNAME: $key = 'tipss'; break; default: $key = 'Tips'; } $result[$key] = $this->collTips->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['Player'][$this->hashCode()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Player'][$this->hashCode()] = true; $keys = PlayerTableMap::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getNr(), $keys[2] => $this->getPoints(), $keys[3] => $this->getExtraPoints(), $keys[4] => $this->getTotalPoints(), $keys[5] => $this->getRank(), $keys[6] => $this->getChampionshipId(), $keys[7] => $this->getAccountId()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aChampionship) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'championship'; break; case TableMap::TYPE_FIELDNAME: $key = 'championships'; break; default: $key = 'Championship'; } $result[$key] = $this->aChampionship->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aAccount) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'account'; break; case TableMap::TYPE_FIELDNAME: $key = 'accounts'; break; default: $key = 'Account'; } $result[$key] = $this->aAccount->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collTips) { switch ($keyType) { case TableMap::TYPE_CAMELNAME: $key = 'tips'; break; case TableMap::TYPE_FIELDNAME: $key = 'tipss'; break; default: $key = 'Tips'; } $result[$key] = $this->collTips->toArray(null, false, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } } return $result; }