/** * @param Sql $sql * @return $this */ public function setSql(Sql $sql) { $this->sql = $sql; if ($this->getTable() && (string) $this->sql->getTable() != (string) $this->getTable()) { throw new Exception\RuntimeException('The table inside the provided Sql object must match the table of this Table'); } return $this; }