Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>What you're wanting is not "technically" supported as a design feature in Doctrine.</p> <p>So if you're wanting to do this as you would with traditional PostgreSQL:</p> <pre><code>SELECT table1.field1, table1.field2, table2.field2, FROM table1 INNER JOIN dblink('dbname=db2 port=5432 host=domainname2 user=someuser password=somepwd', 'SELECT field1, field2, FROM other_table') AS table2(field1 int, field2 char(25)) ON table1.field3 = table2.field1; </code></pre> <p>You would replace the single connection that's default in your config.php file with two connections.</p> <pre><code>&lt;?php Doctrine_Manager::connection('mysql://root@server1/doctrine_db1', 'db1'); Doctrine_Manager::connection('mysql://root@server2/doctrine_db2', 'db2'); </code></pre> <p>Then you'd modify your schema with something like this:</p> <pre><code>--- Table1: tableName: db1.table1 connection: db1 columns: filed1: integer field2: string(255) field3: integer relations: Table2: foreignType: one onDelete: CASCADE Table2: tableName: db2.table2 connection: db2 columns: field1: integer field2: string(25) </code></pre> <p>Then you'd build the database after adding data like normal. Then just do your regular modeling, making sure to specify the table with the field you want like you would with any regular query.</p> <p><a href="http://www.doctrine-project.org/blog/cross-database-joins" rel="nofollow">Doctrine Cross Database Joins</a> are discussed in detail on the Doctrine blog. So you might check it out.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload