Propel 2 API
Class

Propel\Generator\Model\Domain

class Domain extends MappingModel

A class for holding data about a domain used in the schema.

Methods

__construct(string $type = null, string $sqlType = null, string $size = null, string $scale = null)

Creates a new Domain object.

loadMapping(array $attributes)

Loads a mapping definition from an array.

from MappingModel
array getAttributes()

Returns all definition attributes.

from MappingModel
mixed getAttribute(string $name, mixed $default = null)

Returns a particular attribute by a case-insensitive name.

from MappingModel
appendXml(DOMNode $node)

Appends DOM elements to represent this object in XML.

VendorInfo addVendorInfo(VendorInfo|array $vendor)

Adds a new VendorInfo instance to this current model object.

from MappingModel
VendorInfo getVendorInfoForType(string $type)

Returns a VendorInfo object by its type.

from MappingModel
string getConfiguredBehavior(string $behavior)

Returns the best class name for a given behavior.

from MappingModel
string toString()

String representation of the current object.

from MappingModel
string __toString()

String representation of the current object.

from MappingModel
copy(Domain $domain)

Copies the values from current object into passed-in Domain.

setDatabase(Database $database)

Sets the owning database object (if this domain is being setup via XML).

Database getDatabase()

Returns the owning database object (if this domain was setup via XML).

string getDescription()

Returns the domain description.

setDescription(string $description)

Sets the domain description.

string getName()

Returns the domain description.

setName(string $name)

Sets the domain name.

integer getScale()

Returns the scale value.

setScale(integer $scale)

Sets the scale value.

replaceScale(integer $scale)

Replaces the size if the new value is not null.

integer getSize()

Returns the size.

setSize(integer $size)

Sets the size.

replaceSize(integer $size)

Replaces the size if the new value is not null.

string getType()

Returns the mapping type.

setType(string $mappingType)

Sets the mapping type.

replaceType(string $mappingType)

Replaces the mapping type if the new value is not null.

ColumnDefaultValue getDefaultValue()

Returns the default value object.

mixed getPhpDefaultValue()

Returns the default value, type-casted for use in PHP OM.

setDefaultValue(ColumnDefaultValue $value)

Sets the default value.

replaceDefaultValue(ColumnDefaultValue $value = null)

Replaces the default value if the new value is not null.

string getSqlType()

Returns the SQL type.

setSqlType(string $sqlType)

Sets the SQL type.

replaceSqlType(string $sqlType)

Replaces the SQL type if the new value is not null.

string getSizeDefinition()

Returns the size and scale in brackets for use in an sql schema.

Details

at line 43
public __construct(string $type = null, string $sqlType = null, string $size = null, string $scale = null)

Creates a new Domain object.

If this domain needs a name, it must be specified manually.

Parameters

string $type Propel type.
string $sqlType SQL type.
string $size
string $scale

in MappingModel at line 38
public loadMapping(array $attributes)

Loads a mapping definition from an array.

Parameters

array $attributes

in MappingModel at line 58
public array getAttributes()

Returns all definition attributes.

All attribute names (keys) are lowercase.

Return Value

array

in MappingModel at line 73
public mixed getAttribute(string $name, mixed $default = null)

Returns a particular attribute by a case-insensitive name.

If the attribute is not set, then the second default value is
returned instead.

Parameters

string $name
mixed $default

Return Value

mixed

at line 363
public appendXml(DOMNode $node)

Appends DOM elements to represent this object in XML.

Parameters

DOMNode $node

in MappingModel at line 138
public VendorInfo addVendorInfo(VendorInfo|array $vendor)

Adds a new VendorInfo instance to this current model object.

Parameters

VendorInfo|array $vendor

Return Value

VendorInfo

in MappingModel at line 158
public VendorInfo getVendorInfoForType(string $type)

Returns a VendorInfo object by its type.

Parameters

string $type

Return Value

VendorInfo

in MappingModel at line 176
public string getConfiguredBehavior(string $behavior)

Returns the best class name for a given behavior.

If not found, the method tries to autoload \Propel\Generator\Behavior\[Bname]\[Bname]Behavior

Parameters

string $behavior The behavior name (ie: timestampable)

Return Value

string $class The behavior fully qualified class name

Exceptions

BehaviorNotFoundException

in MappingModel at line 198
public string toString()

String representation of the current object.

Return Value

string

in MappingModel at line 213
public string __toString()

String representation of the current object.

Return Value

string

at line 67
public copy(Domain $domain)

Copies the values from current object into passed-in Domain.

Parameters

Domain $domain Domain to copy values into.

at line 104
public setDatabase(Database $database)

Sets the owning database object (if this domain is being setup via XML).

Parameters

Database $database

at line 114
public Database getDatabase()

Returns the owning database object (if this domain was setup via XML).

Return Value

Database

at line 124
public string getDescription()

Returns the domain description.

Return Value

string

at line 134
public setDescription(string $description)

Sets the domain description.

Parameters

string $description

at line 144
public string getName()

Returns the domain description.

Return Value

string

at line 154
public setName(string $name)

Sets the domain name.

Parameters

string $name

at line 164
public integer getScale()

Returns the scale value.

Return Value

integer

at line 174
public setScale(integer $scale)

Sets the scale value.

Parameters

integer $scale

at line 184
public replaceScale(integer $scale)

Replaces the size if the new value is not null.

Parameters

integer $scale

at line 196
public integer getSize()

Returns the size.

Return Value

integer

at line 206
public setSize(integer $size)

Sets the size.

Parameters

integer $size

at line 216
public replaceSize(integer $size)

Replaces the size if the new value is not null.

Parameters

integer $size

at line 228
public string getType()

Returns the mapping type.

Return Value

string

at line 238
public setType(string $mappingType)

Sets the mapping type.

Parameters

string $mappingType

at line 248
public replaceType(string $mappingType)

Replaces the mapping type if the new value is not null.

Parameters

string $mappingType

at line 260
public ColumnDefaultValue getDefaultValue()

Returns the default value object.

Return Value

ColumnDefaultValue

at line 270
public mixed getPhpDefaultValue()

Returns the default value, type-casted for use in PHP OM.

Return Value

mixed

at line 296
public setDefaultValue(ColumnDefaultValue $value)

Sets the default value.

Parameters

ColumnDefaultValue $value

at line 306
public replaceDefaultValue(ColumnDefaultValue $value = null)

Replaces the default value if the new value is not null.

Parameters

ColumnDefaultValue $value

at line 318
public string getSqlType()

Returns the SQL type.

Return Value

string

at line 328
public setSqlType(string $sqlType)

Sets the SQL type.

Parameters

string $sqlType

at line 338
public replaceSqlType(string $sqlType)

Replaces the SQL type if the new value is not null.

Parameters

string $sqlType

at line 350
public string getSizeDefinition()

Returns the size and scale in brackets for use in an sql schema.

Return Value

string