Exemplo n.º 1
0
function reftable($name)
{
    global $defaultSchema;
    $table = new Table($name, new Schema($defaultSchema));
    $table->setIsReference(true);
    return $table;
}
Exemplo n.º 2
0
 /**
  * 
  * @param \yentu\database\Table $table
  * @return \yentu\database\ForeignKey
  */
 public function references($table)
 {
     if ($table->isReference()) {
         $this->foreignTable = $table;
     } else {
         throw new \yentu\exceptions\DatabaseManipulatorException("References cannot be created from a non referencing table. " . "Please use either a reftable() or refschema() " . "construct to link a referenced table");
     }
     return $this;
 }