Adding auto detection of intermediate table names.

Signed-off-by: Taylor Otwell <taylorotwell@gmail.com>
This commit is contained in:
Taylor Otwell
2012-03-16 13:01:48 -05:00
parent c3d95122e4
commit dc92dd264d
3 changed files with 33 additions and 2 deletions

View File

@@ -264,7 +264,7 @@ abstract class Model {
* @param string $other
* @return Relationship
*/
public function has_many_and_belongs_to($model, $table, $foreign = null, $other = null)
public function has_many_and_belongs_to($model, $table = null, $foreign = null, $other = null)
{
return new Has_Many_And_Belongs_To($this, $model, $table, $foreign, $other);
}