Class Phalcon\Db\Reference

implements Phalcon\Db\ReferenceInterface

Source on GitHub

Allows to define reference constraints on tables

  1. <?php
  2. $reference = new \Phalcon\Db\Reference(
  3. "field_fk",
  4. [
  5. "referencedSchema" => "invoicing",
  6. "referencedTable" => "products",
  7. "columns" => [
  8. "product_type",
  9. "product_code",
  10. ],
  11. "referencedColumns" => [
  12. "type",
  13. "code",
  14. ],
  15. ]
  16. );

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