W3cubDocs

/Phalcon 3

Class Phalcon\Db\Reference

implements Phalcon\Db\ReferenceInterface

Source on GitHub

Allows to define reference constraints on tables

$reference = new \Phalcon\Db\Reference("field_fk", array(
    'referencedSchema' => "invoicing",
    'referencedTable' => "products",
    'columns' => array("product_type", "product_code"),
    'referencedColumns' => array("type", "code")
));

Methods

public getName ()

Constraint name

public getSchemaName ()

...

public getReferencedSchema ()

...

public getReferencedTable ()

Referenced Table

public getColumns ()

Local reference columns

public getReferencedColumns ()

Referenced Columns

public getOnDelete ()

ON DELETE

public getOnUpdate ()

ON UPDATE

public __construct (mixed $name, array $definition)

Phalcon\Db\Reference constructor

public static __set_state (array $data)

Restore a Phalcon\Db\Reference object from export

© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/latest/api/Phalcon_Db_Reference.html