class ForeignKey extends XMLElement
A Class for information about foreign keys of a table.
Constants
| NONE | 
 | 
| NOACTION | 
 | 
| CASCADE | 
 | 
| RESTRICT | 
 | 
| SETDEFAULT | 
 | 
| SETNULL | 
 | 
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 $name = null) Constructs a new ForeignKey object. | ||
| normalizeFKey($attrib) normalizes the input of onDelete, onUpdate attributes | ||
| hasOnUpdate() returns whether or not the onUpdate attribute is set | ||
| hasOnDelete() returns whether or not the onDelete attribute is set | ||
| string | getOnUpdate() returns the onUpdate attribute | |
| string | getOnDelete() Returns the onDelete attribute | |
| setOnDelete($value) sets the onDelete attribute | ||
| setOnUpdate($value) sets the onUpdate attribute | ||
| getName() Returns the name attribute. | ||
| setName($name) Sets the name attribute. | ||
| string | getPhpName() Gets the phpName for this foreign key (if any). | |
| setPhpName(string $name) Sets a phpName to use for this foreign key. | ||
| string | getRefPhpName() Gets the refPhpName for this foreign key (if any). | |
| setRefPhpName(string $name) Sets a refPhpName to use for this foreign key. | ||
| string | getDefaultJoin() Gets the defaultJoin for this foreign key (if any). | |
| setDefaultJoin($defaultJoin) Sets a defaultJoin to use for this foreign key. | ||
| string | getForeignTableName() Get the foreignTableName of the FK | |
| string | getForeignTableCommonName() Get the foreign table name without schema | |
| setForeignTableCommonName($tableName) Set the foreignTableCommonName of the FK | ||
| Table | getForeignTable() Gets the resolved foreign Table model object. | |
| getForeignSchemaName() Get the foreignSchemaName of the FK | ||
| setForeignSchemaName($schemaName) Set the foreignSchemaName of the FK | ||
| setTable(Table $parent) Set the parent Table of the foreign key | ||
| getTable() Get the parent Table of the foreign key | ||
| getTableName() Returns the Name of the table the foreign key is in | ||
| getSchemaName() Returns the Name of the schema the foreign key is in | ||
| addReference($p1, $p2 = null) Adds a new reference entry to the foreign key. | ||
| clearReferences() Clear the references of this foreign key | ||
| getLocalColumnNames() Return a comma delimited string of local column names | ||
| getForeignColumnNames() Return a comma delimited string of foreign column names | ||
| array | getLocalColumns() Return an array of local column names. | |
| array | getLocalColumnObjects() Return an array of local column objects. | |
| string | getLocalColumnName($index) Return a local column name. | |
| Column | getLocalColumn($index) Return a local column object. | |
| getLocalForeignMapping() Utility method to get local column to foreign column mapping for this foreign key. | ||
| getForeignLocalMapping() Utility method to get local column to foreign column mapping for this foreign key. | ||
| getColumnObjectsMapping() Utility method to get local and foreign column objects mapping for this foreign key. | ||
| string | getMappedForeignColumn($local) Get the foreign column mapped to specified local column. | |
| string | getMappedLocalColumn($foreign) Get the local column mapped to specified foreign column. | |
| array | getForeignColumns() Return an array of foreign column names. | |
| array | getForeignColumnObjects() Return an array of foreign column objects. | |
| string | getForeignColumnName($index) Return a foreign column name. | |
| Column | getForeignColumn($index) Return a foreign column object. | |
| boolean | isLocalColumnsRequired() Whether this foreign key uses a required column, or a list of required columns. | |
| boolean | isForeignPrimaryKey() Whether this foreign key is also the primary key of the foreign table. | |
| Boolean | isComposite() Whether this foreign key relies on more than one column binding | |
| boolean | isLocalPrimaryKey() Whether this foreign key is also the primary key of the local table. | |
| setSkipSql(boolean $v) Set whether this foreign key should have its creation sql generated. | ||
| boolean | isSkipSql() Skip generating sql for this foreign key. | |
| boolean | isMatchedByInverseFK() Whether this foreign key is matched by an invertes foreign key (on foreign table). | |
| getInverseFK() | ||
| ForeignKey | getOtherFks() Get the other foreign keys starting on the same table Used in many-to-many relationships | 
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.
        in XMLElement at line 58
                    public            array
    getAttributes()
    
    Returns the assoc array of attributes.
All attribute names (keys) are lowercase.
        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.
        at line 652
                    public            
    appendXml(DOMNode $node)
    
    
        in XMLElement at line 127
                    public            VendorInfo
    addVendorInfo(mixed $data)
    
    Sets an associated VendorInfo object.
        in XMLElement at line 146
                    public            VendorInfo
    getVendorInfoForType($type)
    
    Gets the any associated VendorInfo object.
        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'
        in XMLElement at line 189
                    public            
    toString()
    
    String representation of the current object.
This is an xml representation with the XML declaration removed.
        in XMLElement at line 203
                    public            
    __toString()
    
    Magic string method
        at line 58
                    public            
    __construct(string $name = null)
    
    Constructs a new ForeignKey object.
        at line 88
                    public            
    normalizeFKey($attrib)
    
    normalizes the input of onDelete, onUpdate attributes
        at line 104
                    public            
    hasOnUpdate()
    
    returns whether or not the onUpdate attribute is set
        at line 112
                    public            
    hasOnDelete()
    
    returns whether or not the onDelete attribute is set
        at line 121
                    public            string
    getOnUpdate()
    
    returns the onUpdate attribute
        at line 130
                    public            string
    getOnDelete()
    
    Returns the onDelete attribute
        at line 138
                    public            
    setOnDelete($value)
    
    sets the onDelete attribute
        at line 146
                    public            
    setOnUpdate($value)
    
    sets the onUpdate attribute
        at line 154
                    public            
    getName()
    
    Returns the name attribute.
        at line 162
                    public            
    setName($name)
    
    Sets the name attribute.
        at line 171
                    public            string
    getPhpName()
    
    Gets the phpName for this foreign key (if any).
        at line 180
                    public            
    setPhpName(string $name)
    
    Sets a phpName to use for this foreign key.
        at line 189
                    public            string
    getRefPhpName()
    
    Gets the refPhpName for this foreign key (if any).
        at line 198
                    public            
    setRefPhpName(string $name)
    
    Sets a refPhpName to use for this foreign key.
        at line 207
                    public            string
    getDefaultJoin()
    
    Gets the defaultJoin for this foreign key (if any).
        at line 216
                    public            
    setDefaultJoin($defaultJoin)
    
    Sets a defaultJoin to use for this foreign key.
        at line 225
                    public            string
    getForeignTableName()
    
    Get the foreignTableName of the FK
        at line 238
                    public            string
    getForeignTableCommonName()
    
    Get the foreign table name without schema
        at line 246
                    public            
    setForeignTableCommonName($tableName)
    
    Set the foreignTableCommonName of the FK
        at line 255
                    public            Table
    getForeignTable()
    
    Gets the resolved foreign Table model object.
        at line 263
                    public            
    getForeignSchemaName()
    
    Get the foreignSchemaName of the FK
        at line 271
                    public            
    setForeignSchemaName($schemaName)
    
    Set the foreignSchemaName of the FK
        at line 279
                    public            
    setTable(Table $parent)
    
    Set the parent Table of the foreign key
        at line 287
                    public            
    getTable()
    
    Get the parent Table of the foreign key
        at line 295
                    public            
    getTableName()
    
    Returns the Name of the table the foreign key is in
        at line 303
                    public            
    getSchemaName()
    
    Returns the Name of the schema the foreign key is in
        at line 311
                    public            
    addReference($p1, $p2 = null)
    
    Adds a new reference entry to the foreign key.
        at line 330
                    public            
    clearReferences()
    
    Clear the references of this foreign key
        at line 340
                    public            
    getLocalColumnNames()
    
    Return a comma delimited string of local column names
        at line 349
                    public            
    getForeignColumnNames()
    
    Return a comma delimited string of foreign column names
        at line 358
                    public            array
    getLocalColumns()
    
    Return an array of local column names.
        at line 367
                    public            array
    getLocalColumnObjects()
    
    Return an array of local column objects.
        at line 382
                    public            string
    getLocalColumnName($index)
    
    Return a local column name.
        at line 391
                    public            Column
    getLocalColumn($index)
    
    Return a local column object.
        at line 400
                    public            
    getLocalForeignMapping()
    
    Utility method to get local column to foreign column mapping for this foreign key.
        at line 414
                    public            
    getForeignLocalMapping()
    
    Utility method to get local column to foreign column mapping for this foreign key.
        at line 428
                    public            
    getColumnObjectsMapping()
    
    Utility method to get local and foreign column objects mapping for this foreign key.
        at line 447
                    public            string
    getMappedForeignColumn($local)
    
    Get the foreign column mapped to specified local column.
        at line 461
                    public            string
    getMappedLocalColumn($foreign)
    
    Get the local column mapped to specified foreign column.
        at line 475
                    public            array
    getForeignColumns()
    
    Return an array of foreign column names.
        at line 484
                    public            array
    getForeignColumnObjects()
    
    Return an array of foreign column objects.
        at line 499
                    public            string
    getForeignColumnName($index)
    
    Return a foreign column name.
        at line 508
                    public            Column
    getForeignColumn($index)
    
    Return a foreign column object.
        at line 518
                    public            boolean
    isLocalColumnsRequired()
    
    Whether this foreign key uses a required column, or a list of required columns.
        at line 534
                    public            boolean
    isForeignPrimaryKey()
    
    Whether this foreign key is also the primary key of the foreign table.
        at line 558
                    public            Boolean
    isComposite()
    
    Whether this foreign key relies on more than one column binding
        at line 568
                    public            boolean
    isLocalPrimaryKey()
    
    Whether this foreign key is also the primary key of the local table.
        at line 587
                    public            
    setSkipSql(boolean $v)
    
    Set whether this foreign key should have its creation sql generated.
        at line 596
                    public            boolean
    isSkipSql()
    
    Skip generating sql for this foreign key.
        at line 612
                    public            boolean
    isMatchedByInverseFK()
    
    Whether this foreign key is matched by an invertes foreign key (on foreign table).
This is to prevent duplicate columns being generated for a 1:1 relationship that is represented
 by foreign keys on both tables.  I don't know if that's good practice ... but hell, why not
 support it.
        at line 617
                    public            
    getInverseFK()
    
    
        at line 637
                    public            ForeignKey
    getOtherFks()
    
    Get the other foreign keys starting on the same table Used in many-to-many relationships