/** * 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 BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * Defaults to BasePeer::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 = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['State'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['State'][$this->getPrimaryKey()] = true; $keys = StatePeer::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getCode(), $keys[2] => $this->getName(), $keys[3] => $this->getCountryId()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aCountry) { $result['Country'] = $this->aCountry->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collBranchCoverages) { $result['BranchCoverages'] = $this->collBranchCoverages->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collUserProfiles) { $result['UserProfiles'] = $this->collUserProfiles->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collCities) { $result['Cities'] = $this->collCities->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collAreas) { $result['Areas'] = $this->collAreas->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collPrincipals) { $result['Principals'] = $this->collPrincipals->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collStores) { $result['Stores'] = $this->collStores->toArray(null, true, $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 BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * Defaults to BasePeer::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 = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['Store'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Store'][$this->getPrimaryKey()] = true; $keys = StorePeer::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getName(), $keys[2] => $this->getOwner(), $keys[3] => $this->getAddress(), $keys[4] => $this->getCountryId(), $keys[5] => $this->getStateId(), $keys[6] => $this->getRegionId(), $keys[7] => $this->getCityId(), $keys[8] => $this->getAreaId(), $keys[9] => $this->getZipcode(), $keys[10] => $this->getPhone(), $keys[11] => $this->getStoreType(), $keys[12] => $this->getDescription(), $keys[13] => $this->getIsActive(), $keys[14] => $this->getUrl(), $keys[15] => $this->getSortableRank(), $keys[16] => $this->getCreatedAt(), $keys[17] => $this->getUpdatedAt()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aCountry) { $result['Country'] = $this->aCountry->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aState) { $result['State'] = $this->aState->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aRegion) { $result['Region'] = $this->aRegion->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aCity) { $result['City'] = $this->aCity->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aArea) { $result['Area'] = $this->aArea->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collVisitations) { $result['Visitations'] = $this->collVisitations->toArray(null, true, $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 BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * Defaults to BasePeer::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 = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['UserProfile'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['UserProfile'][$this->getPrimaryKey()] = true; $keys = UserProfilePeer::getFieldNames($keyType); $result = array($keys[0] => $this->getPrefix(), $keys[1] => $this->getPrincipalId(), $keys[2] => $this->getNickName(), $keys[3] => $this->getFirstName(), $keys[4] => $this->getMiddleName(), $keys[5] => $this->getLastName(), $keys[6] => $this->getPhone(), $keys[7] => $this->getMobile(), $keys[8] => $this->getAddress(), $keys[9] => $this->getBusinessAddress(), $keys[10] => $this->getOccupation(), $keys[11] => $this->getCity(), $keys[12] => $this->getStateId(), $keys[13] => $this->getZip(), $keys[14] => $this->getCountryId(), $keys[15] => $this->getActivePreferences(), $keys[16] => $this->getComplete(), $keys[17] => $this->getId()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aState) { $result['State'] = $this->aState->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aCountry) { $result['Country'] = $this->aCountry->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aPrincipal) { $result['Principal'] = $this->aPrincipal->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aUser) { $result['User'] = $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 BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, * BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. * Defaults to BasePeer::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 = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['Principal'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Principal'][$this->getPrimaryKey()] = true; $keys = PrincipalPeer::getFieldNames($keyType); $result = array($keys[0] => $this->getId(), $keys[1] => $this->getUserId(), $keys[2] => $this->getName(), $keys[3] => $this->getNameSlug(), $keys[4] => $this->getGovermentLicense(), $keys[5] => $this->getJoinAt(), $keys[6] => $this->getAddress1(), $keys[7] => $this->getAddress2(), $keys[8] => $this->getCity(), $keys[9] => $this->getZipcode(), $keys[10] => $this->getCountryId(), $keys[11] => $this->getStateId(), $keys[12] => $this->getPhone(), $keys[13] => $this->getFax(), $keys[14] => $this->getMobile(), $keys[15] => $this->getEmail(), $keys[16] => $this->getWebsite(), $keys[17] => $this->getLogo(), $keys[18] => $this->getStatus(), $keys[19] => $this->getIsPrincipal(), $keys[20] => $this->getConfirmation(), $keys[21] => $this->getSortableRank(), $keys[22] => $this->getCreatedAt(), $keys[23] => $this->getUpdatedAt()); $virtualColumns = $this->virtualColumns; foreach ($virtualColumns as $key => $virtualColumn) { $result[$key] = $virtualColumn; } if ($includeForeignObjects) { if (null !== $this->aUser) { $result['User'] = $this->aUser->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aState) { $result['State'] = $this->aState->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->aCountry) { $result['Country'] = $this->aCountry->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true); } if (null !== $this->collUserProfiles) { $result['UserProfiles'] = $this->collUserProfiles->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collProducts) { $result['Products'] = $this->collProducts->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } if (null !== $this->collPrincipalI18ns) { $result['PrincipalI18ns'] = $this->collPrincipalI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects); } } return $result; }