You are here

function country_create in Countries 8

Same name and namespace in other branches
  1. 7.2 countries.module \country_create()

Creates a default country object.

Parameters

array $properties: An array of additional properties to add to the new object.

Return value

object A country strut by the additional properties and defaulted to the schema defined defaults.

9 calls to country_create()
CountriesBaseSetupTest::assertCountryListed in tests/countries.test
CountriesCacheUnitTest::testCache in tests/countries.test
CountriesCRUDUIUnitTest::testCountriesAddition in tests/countries.test
This test that the country property lookup is working.
CountriesCRUDUnitTest::testCountriesCRUD in tests/countries.test
This test that the country property lookup is working.
CountriesFunctionsUnitTest::testCountriesLock in tests/countries.test
This test that core countries can not be deleted while user ones are.

... See full list

File

./countries.module, line 270
Defines the field and entity information for countries.

Code

function country_create($properties = array()) {
  return entity_create('country', $properties + array(
    'cid' => NULL,
    'iso2' => '',
    'iso3' => '',
    'name' => '',
    'official_name' => '',
    'continent' => 'UN',
    'enabled' => 1,
    'numcode' => 0,
  ));
}