src/Titon/Db/Driver/Schema.php
public function addForeign($column, $options = []) {
        if (is_string($options)) {
            $options = ['references' => $options];
        }

        if (empty($options['references'])) {
            throw new InvalidArgumentException(sprintf('Foreign key for %s must reference an external table', $column));
        }

        $this->_foreignKeys[$column] = $options + [
            'column' => $column,
            'constraint' => ''
        ];
    }
public function addForeign($column, $options = []) {
        if (is_string($options)) {
            $options = ['references' => $options];
        }

        if (empty($options['references'])) {
            throw new InvalidArgumentException(sprintf('Foreign key for %s must reference an external table', $column));
        }

        $this->_foreignKeys[$column] = $options + [
            'column' => $column,
            'constraint' => ''
        ];
    }
public function addForeign ( $ column , $ options = [ ] ) { if ( is_string ( $ options ) ) { $ options = [ 'references' => $ options ] ; } if ( empty ( $ options [ 'references' ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Foreign key for %s must reference an external table' , $ column ) ) ; } $ this -> _foreignKeys [ $ column ] = $ options + [ 'column' => $ column , 'constraint' => '' ] ; }
Add a foreign key for a column.
Multiple foreign keys can exist so group by column.

@param string $column
@param string|array $options {
@type string $references    A table and field that the foreign key references, should be in a "user.id" format
@type string $onUpdate      Action to use for ON UPDATE clauses
@type string $onDelete      Action to use for ON DELETE clauses
}
@return $this
@throws \Titon\Db\Exception\InvalidArgumentException
Add a foreign key for a column . Multiple foreign keys can exist so group by column .