/** * @expectedException \LiftKit\Database\Schema\Exception\NonexistentTable */ public function testFailsWithNonexistentTable() { $schema = new Schema($this->connection); $childrenTable = $schema->defineTable('children'); $parentsTable = $schema->defineTable('parents'); $schema->getTable('nonexistent'); }
/** * @param string $relatedTable * @param string $relationalTable * @param null|string $relatedKey * @param null|string $key * @param null|string $relationIdentifier * * @return $this * @throws RelationException */ public function manyToMany($relatedTable, $relationalTable, $relatedKey = null, $key = null, $relationIdentifier = null) { if (is_null($relationIdentifier)) { $relationIdentifier = $relatedTable; } $this->relations[$relationIdentifier] = new ManyToMany($this, $this->schema->getTable($relatedTable, true), $this->schema->getTable($relationalTable, true), $key, $relatedKey); return $this; }
/** * @param string $tableName * * @return Table */ protected function getTable($tableName) { return $this->schema->getTable($tableName); }