Created
October 29, 2010 15:32
-
-
Save mavimo/653762 to your computer and use it in GitHub Desktop.
Schema del DB (due entità, A e B)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* BTable | |
* | |
* This class has been auto-generated by the Doctrine ORM Framework | |
*/ | |
class BTable extends Doctrine_Table | |
{ | |
/** | |
* Returns an instance of this class. | |
* | |
* @return object BTable | |
*/ | |
public static function getInstance() | |
{ | |
return Doctrine_Core::getTable('B'); | |
} | |
/** | |
* Parte aggiunta | |
*/ | |
function construct() | |
{ | |
// Imposto il criterio di sorting. | |
$this->setOption('orderBy', 'sorting ASC'); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Entity A | |
A: | |
columns: | |
name: string(255) | |
relations: | |
Bs: | |
type: many | |
class: B | |
local: id | |
foreign: a_id | |
onDelete: CASCADE | |
# Entity B | |
B: | |
columns: | |
a_id: integer | |
name: string(255) | |
sorting: integer | |
relations: | |
A: | |
local: a_id | |
foreign: id | |
type: one |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment