Propel API
Class

Domain

class Domain extends XMLElement

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

Methods

loadFromXML(array $attributes)

This is the entry point method for loading data from XML.

from XMLElement
array getAttributes()

Returns the assoc array of attributes.

from XMLElement
mixed getAttribute(string $name, mixed $defaultValue = null)

Gets a particular attribute by [case-insensitive] name.

from XMLElement
appendXml(DOMNode $node)

VendorInfo addVendorInfo(mixed $data)

Sets an associated VendorInfo object.

from XMLElement
VendorInfo getVendorInfoForType($type)

Gets the any associated VendorInfo object.

from XMLElement
string getConfiguredBehavior(string $bname)

Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior'

from XMLElement
toString()

String representation of the current object.

from XMLElement
__toString()

Magic string method

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

Creates a new Domain object.

copy(Domain $domain)

Copy 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()

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

string getDescription()

setDescription(string $description)

string getName()

setName(string $name)

string getScale()

setScale(string $scale)

replaceScale(string $value)

Replaces the size if the new value is not null.

int getSize()

setSize(int $size)

replaceSize(int $value)

Replaces the size if the new value is not null.

string getType()

setType(string $propelType)

replaceType(string $value)

Replaces the type if the new value is not null.

ColumnDefaultValue getDefaultValue()

Gets the default value object.

mixed getPhpDefaultValue()

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

setDefaultValue(ColumnDefaultValue $value)

replaceDefaultValue(ColumnDefaultValue $value = null)

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

string getSqlType()

setSqlType(string $sqlType)

replaceSqlType(string $sqlType)

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

string printSize()

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

Details

in XMLElement at line 47
public loadFromXML(array $attributes)

This is the entry point method for loading data from XML.

It calls a setupObject() method that must be implemented by the child class.

Parameters

array $attributes The attributes for the XML tag.

in XMLElement at line 58
public array getAttributes()

Returns the assoc array of attributes.

All attribute names (keys) are lowercase.

Return Value

array

in XMLElement at line 70
public mixed getAttribute(string $name, mixed $defaultValue = null)

Gets a particular attribute by [case-insensitive] name.

If attribute is not set then the $defaultValue is returned.

Parameters

string $name The [case-insensitive] name of the attribute to lookup.
mixed $defaultValue The default value to use in case the attribute is not set.

Return Value

mixed The value of the attribute or $defaultValue if not set.

at line 358
public appendXml(DOMNode $node)

Parameters

DOMNode $node

See also

XMLElement::appendXml(DOMNode)

in XMLElement at line 127
public VendorInfo addVendorInfo(mixed $data)

Sets an associated VendorInfo object.

Parameters

mixed $data VendorInfo object or XML attrib data (array)

Return Value

VendorInfo

in XMLElement at line 146
public VendorInfo getVendorInfoForType($type)

Gets the any associated VendorInfo object.

Parameters

$type

Return Value

VendorInfo

in XMLElement at line 166
public string getConfiguredBehavior(string $bname)

Find the best class name for a given behavior Looks in build.properties for path like propel.behavior.[bname].class If not found, tries to autoload [Bname]Behavior If no success, returns 'Behavior'

Parameters

string $bname behavior name, e.g. 'timestampable'

Return Value

string behavior class name, e.g. 'TimestampableBehavior'

Exceptions

InvalidArgumentException

in XMLElement at line 189
public toString()

String representation of the current object.

This is an xml representation with the XML declaration removed.

See also

appendXml()

in XMLElement at line 203
public __toString()

Magic string method

See also

toString()

at line 73
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

at line 85
public copy(Domain $domain)

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

Parameters

Domain $domain Domain to copy values into.

at line 125
public setDatabase(Database $database)

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

Parameters

Database $database

at line 134
public Database getDatabase()

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

Return Value

Database

at line 142
public string getDescription()

Return Value

string Returns the description.

at line 150
public setDescription(string $description)

Parameters

string $description The description to set.

at line 158
public string getName()

Return Value

string Returns the name.

at line 166
public setName(string $name)

Parameters

string $name The name to set.

at line 174
public string getScale()

Return Value

string Returns the scale.

at line 182
public setScale(string $scale)

Parameters

string $scale The scale to set.

at line 192
public replaceScale(string $value)

Replaces the size if the new value is not null.

Parameters

string $value The size to set.

at line 202
public int getSize()

Return Value

int Returns the size.

at line 210
public setSize(int $size)

Parameters

int $size The size to set.

at line 220
public replaceSize(int $value)

Replaces the size if the new value is not null.

Parameters

int $value The size to set.

at line 230
public string getType()

Return Value

string Returns the propelType.

at line 238
public setType(string $propelType)

Parameters

string $propelType The PropelTypes type to set.

at line 248
public replaceType(string $value)

Replaces the type if the new value is not null.

Parameters

string $value The tyep to set.

at line 259
public ColumnDefaultValue getDefaultValue()

Gets the default value object.

Return Value

ColumnDefaultValue The default value object for this domain.

at line 270
public mixed getPhpDefaultValue()

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

Return Value

mixed

Exceptions

EngineException

See also

getDefaultValue()

at line 294
public setDefaultValue(ColumnDefaultValue $value)

Parameters

ColumnDefaultValue $value The column default value to set.

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

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

Parameters

ColumnDefaultValue $value The defualt value object

at line 314
public string getSqlType()

Return Value

string Returns the sqlType.

at line 322
public setSqlType(string $sqlType)

Parameters

string $sqlType The sqlType to set.

at line 331
public replaceSqlType(string $sqlType)

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

Parameters

string $sqlType The native SQL type to use for this domain.

at line 344
public string printSize()

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

Return Value

string Size and scale or an empty String if there are no values available.