/** * * @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; }